Skip to content

Commit 73b9bf8

Browse files
authored
Merge pull request #577 from blckmn/release-process
Automated release build process as per configurator
2 parents 192519a + 7d173fc commit 73b9bf8

File tree

2 files changed

+53
-8
lines changed

2 files changed

+53
-8
lines changed

.github/workflows/build-release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## This is triggered by the publishing of a release, and will build the assets and attach them.
2+
3+
name: On Release
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
ci:
11+
name: CI
12+
uses: ./.github/workflows/ci.yml
13+
with:
14+
debug_build: false
15+
16+
release:
17+
name: Attach Release Artifacts
18+
needs: ci
19+
runs-on: ubuntu-22.04
20+
steps:
21+
- name: Code Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Fetch build artifacts
25+
uses: actions/download-artifact@v2
26+
27+
- name: List assets
28+
run: ls -al Betaflight-*/*
29+
30+
- name: Attach assets to release
31+
run: |
32+
set -x
33+
assets=()
34+
for asset in Betaflight-*/*; do
35+
assets+=("-a" "$asset")
36+
echo "$asset"
37+
done
38+
tag_name="${GITHUB_REF##*/}"
39+
hub release edit "${assets[@]}" -m "" "$tag_name"
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Builds Betaflight Blackbox Explorer on Windows, Linux and macOS platforms.
22
#
3-
# After building, artifacts are released to a separate repository.
4-
5-
env:
6-
debugBuild: true
3+
# After building, artifacts are released to a seperate repository.
74

85
name: CI
96

10-
on: workflow_call
7+
on:
8+
workflow_call:
9+
inputs:
10+
debug_build:
11+
description: 'Specifies if it is a debug build or a release build'
12+
default: true
13+
required: false
14+
type: boolean
1115

1216
jobs:
1317
build:
@@ -45,14 +49,14 @@ jobs:
4549
- run: yarn install --immutable --immutable-cache --check-cache
4650

4751
- run: yarn gulp release ${{ matrix.releaseArgs }}
48-
if: ${{ !env.debugBuild }}
52+
if: ${{ !inputs.debug_build }}
4953

5054
- run: yarn gulp debug-release ${{ matrix.releaseArgs }}
51-
if: ${{ env.debugBuild }}
55+
if: ${{ inputs.debug_build }}
5256

5357
- name: Publish build artifacts
5458
uses: actions/upload-artifact@v2
5559
with:
56-
name: Betaflight-Blackbox-Explorer${{ env.debugBuild == 'true' && '-Debug' || '' }}-${{ matrix.name }}
60+
name: Betaflight-Blackbox-Explorer${{ inputs.debug_build == 'true' && '-Debug' || '' }}-${{ matrix.name }}
5761
path: release/
5862
retention-days: 90

0 commit comments

Comments
 (0)