Repository navigation
49 lines (43 loc) · 1.56 KB
/
Copy pathci.yml
File metadata and controls
49 lines (43 loc) · 1.56 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
name: CI
# Builds a debug APK on every push to main and publishes it as a rolling
# "dev-build" prerelease. Manual runs are allowed from the Actions tab.
on:
push:
branches:
- 'main'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup JDK
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "21"
- name: Build APK
run: ./gradlew assembleDebug
# Re-publish the rolling "dev-build" prerelease at the current commit. Uses the
# preinstalled gh CLI with the workflow's contents:write token (the old
# marvinpinto action fails with "Resource not accessible by integration").
- name: Publish dev-build prerelease
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Notes = latest commit subject + disclaimer. Written via git (not shell-
# interpolated) so backticks/$ in the message can't be evaluated.
{
git log -1 --pretty=format:'%s'
printf '\n\nLatest development build from main. May contain bugs; no automatic updates.\n'
} > release-notes.md
gh release delete dev-build --yes --cleanup-tag || true
gh release create dev-build \
app/build/outputs/apk/debug/openCook-debug.apk \
--prerelease \
--target "$GITHUB_SHA" \
--title "openCook development build" \
--notes-file release-notes.md