Skip to content

Commit

Permalink
Adding a release workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
blckmn committed Apr 11, 2022
1 parent 642689d commit 6f81ddb
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build-release.yml
@@ -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 changes: 35 additions & 0 deletions .github/workflows/ci.yml
@@ -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

0 comments on commit 6f81ddb

Please sign in to comment.