Fix msp API_VERSION_MINOR (#12001)
[betaflight.git] / .github / workflows / nightly.yml
blobfe504f92d50dcd0df4f7c800de8d97b18408febb
1 # You'll need to setup the follwing environment variables:
2 #   env.repo_nightly - The repository to release nightly builds to e.g. betaflight-nightly
3 #   env.release_notes - The release notes to be published as part of the github release
4 #   env.debug_release_notes - The release notes to be published as part of the github debug release
5 #   secrets.REPO_TOKEN - A GitHub token with permissions to push and publish releases to the nightly repo
7 env:
8   repo_nightly: betaflight/betaflight-nightlies
9   debug_release_notes: >
10     This is an automated development build.
11     It may be unstable and result in craft loss or damage.
12     **Use only for testing.**
13   release_notes: This is a release build. 
15 name: Nightly
17 on:
18   push:
19     branches:
20       - master
22 jobs:
23   ci:
24     name: CI
25     uses: ./.github/workflows/ci.yml
26     with:
27       release_build: false
29   release:
30     name: Nightly release
31     needs: ci
32     runs-on: ubuntu-22.04
33     steps:
34       - name: Code Checkout
35         uses: actions/checkout@v3
36         
37       - name: Fetch build artifacts
38         uses: actions/download-artifact@v3
40       - name: Select release notes
41         id: notes
42         run: |
43           set -- Assets/*.hex
44           echo "notes=$(test -e "$1" && echo '${{ env.debug_release_notes }}' || echo '${{ env.release_notes }}')" >> $GITHUB_OUTPUT
46       - name: Get current date
47         id: date
48         run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
50       - name: Release
51         uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
52         with:
53           token: ${{ secrets.REPO_TOKEN }}
54           repository: ${{ env.repo_nightly }}
55           tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
56           files: Assets/*.hex
57           draft: false
58           prerelease: false
59           fail_on_unmatched_files: true
60           body: |
61             ${{ steps.notes.outputs.notes }}
63             ### Repository:
64             ${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
66             ### Branch:
67             ${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
69             ### Latest changeset:
70             ${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
72             ### Changes:
73             ${{ github.event.head_commit.message }}