-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
29 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 |
---|---|---|
@@ -1,32 +1,55 @@ | ||
name: Firmware release | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
name: Create Release | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
- uses: actions/checkout@v3 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
#body: | | ||
# Changes in this Release | ||
# - First Change | ||
# - Second Change | ||
draft: true | ||
prerelease: false | ||
#- name: Install PlatformIO Core | ||
# run: pip install --upgrade platformio | ||
#- name: Build PlatformIO Project | ||
# run: pio run | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.platformio | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade platformio | ||
- name: Extract build version | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Run PlatformIO | ||
env: | ||
VERSION: ${{ steps.get_version.outputs.version-without-v }} | ||
run: pio run | ||
|
||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: firmware | ||
path: .pio/build/**/mobiflight*.hex | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: .pio/build/**/firmware*.hex |