Add display port sub-command definitions
[betaflight.git] / .github / workflows / nightly.yml
blobd88d72c072ebf3ff852914135535fd3d0227f4a2
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   schedule:
19     - cron: "0 1 * * *"
20   push:
21     branches:
22       - master
24 jobs:
25   ci:
26     name: CI
27     uses: ./.github/workflows/ci.yml
28     with:
29       release_build: false
31   release:
32     name: Nightly release
33     needs: ci
34     runs-on: ubuntu-22.04
35     steps:
36       - name: Code Checkout
37         uses: actions/checkout@v2
38         
39       - name: Fetch build artifacts
40         uses: actions/download-artifact@v2
42       - name: Select release notes
43         id: notes
44         run: |
45           set -- Assets/*.hex
46           echo "::set-output name=notes::$(test -e "$1" && echo '${{ env.debug_release_notes }}' || echo '${{ env.release_notes }}')"
48       - name: Get current date
49         id: date
50         run: echo "::set-output name=today::$(date '+%Y%m%d')"
52       - name: Release
53         uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
54         with:
55           token: ${{ secrets.REPO_TOKEN }}
56           repository: ${{ env.repo_nightly }}
57           tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
58           files: Assets/*.hex
59           draft: false
60           prerelease: false
61           fail_on_unmatched_files: true
62           body: |
63             ${{ steps.notes.outputs.notes }}
65             ### Repository:
66             ${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
68             ### Branch:
69             ${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
71             ### Latest changeset:
72             ${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
74             ### Changes:
75             ${{ github.event.head_commit.message }}