|
| 1 | +# You'll need to setup the follwing environment variables: |
| 2 | +# env.repoNightly - The repository to release nightly builds to e.g. betaflight-configurator-nightly |
| 3 | +# env.releaseNotes - The release notes to be published as part of the github release |
| 4 | +# env.debugReleaseNotes - 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 | + repoNightly: betaflight/blackbox-log-viewer-nightlies |
| 9 | + debugReleaseNotes: > |
| 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 | + releaseNotes: This is a release build. It does not contain the debug console. |
| 14 | + |
| 15 | +name: Nightly |
| 16 | + |
| 17 | +on: |
| 18 | + push: |
| 19 | + branches: |
| 20 | + - master |
| 21 | + - '*-maintenance' |
| 22 | + |
| 23 | +jobs: |
| 24 | + ci: |
| 25 | + name: CI |
| 26 | + uses: ./.github/workflows/ci.yml |
| 27 | + |
| 28 | + release: |
| 29 | + name: Release |
| 30 | + needs: ci |
| 31 | + runs-on: ubuntu-20.04 |
| 32 | + steps: |
| 33 | + - name: Fetch build artifacts |
| 34 | + uses: actions/download-artifact@v2 |
| 35 | + with: |
| 36 | + path: release-assets/ |
| 37 | + |
| 38 | + - name: Select release notes |
| 39 | + id: notes |
| 40 | + run: | |
| 41 | + set -- release-assets/Betaflight-Blackbox-Explorer-Debug-* |
| 42 | + echo "::set-output name=notes::$(test -e "$1" && echo '${{ env.debugReleaseNotes }}' || echo '${{ env.releaseNotes }}')" |
| 43 | +
|
| 44 | + - name: Get current date |
| 45 | + id: date |
| 46 | + run: echo "::set-output name=today::$(date '+%Y%m%d')" |
| 47 | + |
| 48 | + - name: Release |
| 49 | + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14 |
| 50 | + with: |
| 51 | + token: ${{ secrets.REPO_TOKEN }} |
| 52 | + repository: ${{ env.repoNightly }} |
| 53 | + tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }} |
| 54 | + files: release-assets/Betaflight-Blackbox-Explorer-*/** |
| 55 | + draft: false |
| 56 | + prerelease: false |
| 57 | + fail_on_unmatched_files: true |
| 58 | + body: | |
| 59 | + ${{ steps.notes.outputs.notes }} |
| 60 | +
|
| 61 | + ### Repository: |
| 62 | + ${{ github.repository }} ([link](${{ github.event.repository.html_url }})) |
| 63 | +
|
| 64 | + ### Branch: |
| 65 | + ${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }})) |
| 66 | +
|
| 67 | + ### Latest changeset: |
| 68 | + ${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }})) |
| 69 | +
|
| 70 | + ### Changes: |
| 71 | + ${{ github.event.head_commit.message }} |
0 commit comments