From 8a2470198a8a45ba102f096ef6a6ae88f6282c1f Mon Sep 17 00:00:00 2001 From: Greg Cormier Date: Tue, 1 Mar 2022 10:24:09 -0500 Subject: [PATCH] automated build+release on tag action --- .github/workflows/version_pio_build.yml | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/version_pio_build.yml diff --git a/.github/workflows/version_pio_build.yml b/.github/workflows/version_pio_build.yml new file mode 100644 index 0000000..0061b7d --- /dev/null +++ b/.github/workflows/version_pio_build.yml @@ -0,0 +1,46 @@ +name: "Build firmware and add release on tag v*" +on: + push: + tags: + - v* + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install pyhon + uses: actions/setup-python@v2 + + - name: Install pio + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + + - name: Build noserial + run: pio run --project-dir ./Code --environment attiny841_noserial + + - name: Rename noserial firmware + run: | + mv ./Code/.pio/build/attiny841_noserial/firmware.hex ./Code/.pio/build/attiny841_noserial/megadesk-$GITHUB_REF_NAME.hex + FILENAME=./Code/.pio/build/attiny841_noserial/megadesk-$GITHUB_REF_NAME.hex + echo "FILENAME=$FILENAME" >> $GITHUB_ENV + + - name: Build serial + run: pio run --project-dir ./Code --environment attiny841_serial + + - name: Rename serial firmware + run: | + mv ./Code/.pio/build/attiny841_serial/firmware.hex ./Code/.pio/build/attiny841_serial/megadesk-$GITHUB_REF_NAME-serial.hex + SFILENAME=./Code/.pio/build/attiny841_serial/megadesk-$GITHUB_REF_NAME-serial.hex + echo "SFILENAME=$SFILENAME" >> $GITHUB_ENV + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + ${{ env.FILENAME }} + ${{ env.SFILENAME }} +