|
| 1 | +# You'll need to setup the follwing environment variables: |
| 2 | +# env.repo_nightly - The repository to release nightly builds to e.g. betaflight-tx-lua-scripts-nightlies |
| 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 |
| 6 | + |
| 7 | +env: |
| 8 | + repo_nightly: betaflight/betaflight-tx-lua-scripts-nightlies |
| 9 | + debug_release_notes: > |
| 10 | + This is an automated development build. |
| 11 | + It may be unstable and result in corrupted configurations or data loss. |
| 12 | + **Use only for testing.** |
| 13 | + release_notes: This is a release build. |
| 14 | + |
| 15 | +name: Nightly |
| 16 | + |
| 17 | +on: |
| 18 | + push: |
| 19 | + branches: |
| 20 | + - master |
| 21 | + |
| 22 | +jobs: |
| 23 | + ci: |
| 24 | + name: CI |
| 25 | + uses: ./.github/workflows/ci.yml |
| 26 | + with: |
| 27 | + release_build: false |
| 28 | + |
| 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 |
| 39 | + |
| 40 | + - name: Select release notes |
| 41 | + id: notes |
| 42 | + run: | |
| 43 | + set -- Assets/*.zip |
| 44 | + echo "notes=$(test -e "$1" && echo '${{ env.debug_release_notes }}' || echo '${{ env.release_notes }}')" >> $GITHUB_OUTPUT |
| 45 | + - name: Get current date |
| 46 | + id: date |
| 47 | + run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT |
| 48 | + |
| 49 | + - name: Release |
| 50 | + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14 |
| 51 | + with: |
| 52 | + token: ${{ secrets.REPO_TOKEN }} |
| 53 | + repository: ${{ env.repo_nightly }} |
| 54 | + tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }} |
| 55 | + files: Assets/*.zip |
| 56 | + draft: false |
| 57 | + prerelease: false |
| 58 | + fail_on_unmatched_files: true |
| 59 | + body: | |
| 60 | + ${{ steps.notes.outputs.notes }} |
| 61 | + ### Repository: |
| 62 | + ${{ github.repository }} ([link](${{ github.event.repository.html_url }})) |
| 63 | + ### Branch: |
| 64 | + ${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }})) |
| 65 | + ### Latest changeset: |
| 66 | + ${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }})) |
| 67 | + ### Changes: |
| 68 | + ${{ github.event.head_commit.message }} |
0 commit comments