Repository navigation
84 lines (73 loc) · 2.64 KB
/
Copy pathci.yml
File metadata and controls
84 lines (73 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Check and Build
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Install tools
run: make install-tools
- name: Run checks
run: make check
- name: Set version
env:
EVENT: ${{ github.event_name }}
PR: ${{ github.event.pull_request.number }}
# On pull_request, github.sha is GitHub's temporary merge commit.
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
version="${SHA::7}"
if [ "$EVENT" = pull_request ]; then
zip_name="expresslrs-lua-pr${PR}-${version}"
elif [ "$GITHUB_REF" = refs/heads/master ]; then
zip_name=expresslrs-lua-nightly
else
zip_name="expresslrs-lua-${GITHUB_REF_NAME//\//-}-${version}"
fi
echo "VERSION=$version" >> "$GITHUB_ENV"
echo "ZIP_NAME=$zip_name" >> "$GITHUB_ENV"
- name: Build
run: make build VERSION="$VERSION" ZIP_NAME="$ZIP_NAME"
- uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_NAME }}
path: dist/*.zip
if-no-files-found: error
nightly:
name: Publish Nightly
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-26.04
permissions:
contents: write
concurrency:
group: nightly
cancel-in-progress: true
steps:
- uses: actions/download-artifact@v4
with:
name: expresslrs-lua-nightly
path: dist
- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release delete nightly --repo "$GITHUB_REPOSITORY" --cleanup-tag --yes || true
gh release create nightly dist/*.zip \
--repo "$GITHUB_REPOSITORY" \
--target "$GITHUB_SHA" \
--title "Nightly (development build)" \
--prerelease \
--latest=false \
--notes "**Development build, not a stable release.** Built automatically from the latest \`master\` commit ($GITHUB_SHA). It may contain unfinished or untested changes; for normal use, install the [latest release](https://github.com/$GITHUB_REPOSITORY/releases/latest).
The tools show version \`${GITHUB_SHA::7}\`. To install, extract \`expresslrs-lua-nightly.zip\` onto the SD card root. Older EdgeTX, OpenTX or low-RAM radios: use \`expresslrs-lua-legacy.zip\` instead."