Skip to content

Commit 5b39578

Browse files
committed
Adding a build and attach to release workflow (upon release creation).
1 parent ca0e79a commit 5b39578

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
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-20.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 }}

0 commit comments

Comments
 (0)