Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Montecri authored Mar 5, 2024
1 parent 56edb8c commit fa71b31
Showing 1 changed file with 52 additions and 29 deletions.
81 changes: 52 additions & 29 deletions .github/workflows/release.yml
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

0 comments on commit fa71b31

Please sign in to comment.