Adding a release workflow.
[betaflight.git] / .github / workflows / build-release.yml
blobe253cca1c10f775dbf35f0903f277435270cbe62
1 name: Release
3 on:
4   release:
5     types: [published]
6         
7 jobs:
8   ci:
9     name: CI
10     uses: ./.github/workflows/ci.yml
11     with:
12       release_build: true
14   release:
15     name: Release
16     needs: ci
17     runs-on: ubuntu-20.04
18     steps:
19       - name: Code Checkout
20         uses: actions/checkout@v2
22       - name: Fetch build artifacts
23         uses: actions/download-artifact@v2
25       - name: List assets
26         run: ls -al Assets
28       - name: Attach assets to release
29         run: |
30           set -x
31           assets=()
32           for asset in Assets/*.hex; do
33             assets+=("-a" "$asset")
34             echo "$asset"
35           done
36           tag_name="${GITHUB_REF##*/}"
37           hub release edit "${assets[@]}" -m "" "$tag_name"
38         env:
39           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}