-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automated build+release on tag action
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||