Adding a release workflow.

This commit is contained in:
blckmn 2022-04-11 18:23:01 +10:00
parent 642689dfc7
commit 6f81ddb2b4
2 changed files with 74 additions and 0 deletions

39
.github/workflows/build-release.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Release
on:
release:
types: [published]
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
release_build: true
release:
name: Release
needs: ci
runs-on: ubuntu-20.04
steps:
- name: Code Checkout
uses: actions/checkout@v2
- name: Fetch build artifacts
uses: actions/download-artifact@v2
- name: List assets
run: ls -al Assets
- name: Attach assets to release
run: |
set -x
assets=()
for asset in Assets/*.hex; do
assets+=("-a" "$asset")
echo "$asset"
done
tag_name="${GITHUB_REF##*/}"
hub release edit "${assets[@]}" -m "" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

35
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,35 @@
# Builds Betaflight Firmware.
#
# After building, artifacts are kept for 7 days.
name: CI
on:
workflow_call:
inputs:
release_build:
description: 'Specifies if it is a debug build or a release build'
default: false
required: false
type: boolean
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Code Checkout
uses: actions/checkout@v2
- name: Prepare environment
run: make arm_sdk_install
- name: Execute Build
run: make all RELEASE=${{ inputs.release_build && 'yes' || 'no' }}
- name: Publish build artifacts
uses: actions/upload-artifact@v3
with:
name: Assets
path: ./obj/*.hex
retention-days: 7