Skip to content

Commit 55d27c6

Browse files
committed
Add nightly build
1 parent 5974fce commit 55d27c6

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
# secrets.REPO_TOKEN - A GitHub token with permissions to push and publish releases to the nightly repo
5+
6+
env:
7+
repoNightly: betaflight/betaflight-configurator-nightlies
8+
debugReleaseNotes: >
9+
This is an automated development build.
10+
It may be unstable and result in corrupted configurations or data loss.
11+
**Use only for testing.**
12+
releaseNotes: This is a release build. It does not contain the debug console.
13+
14+
name: Nightly Build
15+
16+
on:
17+
workflow_run:
18+
workflows: [CI]
19+
types: [completed]
20+
21+
jobs:
22+
release-nightly:
23+
name: Release Nightly
24+
runs-on: ubuntu-20.04
25+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
26+
steps:
27+
- name: Fetch release assets
28+
uses: dawidd6/action-download-artifact@09385b76de790122f4da9c82b17bccf858b9557c # v2.16.0
29+
with:
30+
path: release-assets/
31+
workflow: ${{ github.event.workflow_run.workflow_id }}
32+
33+
- name: Select release notes
34+
id: notes
35+
run: |
36+
set -- release-assets/Betaflight-Configurator-Debug-*
37+
echo "::set-output name=notes::$(test -e "$1" && echo '${{ env.debugReleaseNotes }}' || echo '${{ env.releaseNotes }}')"
38+
39+
- name: Release
40+
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
41+
with:
42+
token: ${{ secrets.REPO_TOKEN }}
43+
repository: ${{ env.repoNightly }}
44+
tag_name: build-${{ github.run_number }}
45+
files: release-assets/Betaflight-Configurator-*/**
46+
draft: false
47+
prerelease: false
48+
fail_on_unmatched_files: true
49+
name: '${{ github.repository }}: ${{ github.ref_name }}'
50+
body: |
51+
${{ steps.notes.outputs.notes }}
52+
53+
### Repository:
54+
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
55+
56+
### Branch:
57+
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
58+
59+
### Latest changeset:
60+
${{ github.sha }} ([link](https://github.com/${{ github.repository }}/commit/${{ github.sha }}))
61+
62+
### Changes:
63+
${{ github.event.workflow_run.head_commit.message }}

0 commit comments

Comments
 (0)