Skip to content

Commit

Permalink
automated build+release on tag action
Browse files Browse the repository at this point in the history
  • Loading branch information
gcormier committed Mar 1, 2022
1 parent 42ac1d4 commit 8a24701
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/version_pio_build.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 8a24701

Please sign in to comment.