-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (75 loc) · 2.68 KB
/
nightly.yml
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
85
86
87
name: nightly
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
ref: 'dev'
token: ${{secrets.ACCESS_TOKEN}}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: "Determine next tag"
id: tagger
run: |
TAG="$(git tag --sort=-v:refname | grep nightly- | head -n 1)"
VERSION="$(echo $TAG | sed -e s/[^0-9]//g)"
INCREMENT="$((VERSION + 1))"
NEW_TAG="nightly-${INCREMENT}"
echo next tag '${NEW_TAG}'
echo "::set-output name=new_tag::${NEW_TAG}"
- name: "Pull upstream"
run: |
git remote add upstream https://github.com/TeamNewPipe/NewPipe.git
git pull upstream dev
- name: "Build release apk"
run: ./gradlew assembleRelease --stacktrace -DpackageSuffix=nightly
- name: "Check for new commits"
run : |
if [[ "$(git log --since=1.days)" ]]; then
echo "New commits found"
echo "new_commit=true" >> $GITHUB_ENV
fi
- name: "Tag commit"
if: ${{ env.new_commit == 'true' }}
run: git tag "${{ steps.tagger.outputs.new_tag }}"
- name: "Push to nightly repo"
if: ${{ env.new_commit == 'true' }}
uses: ad-m/[email protected]
with:
github_token: ${{secrets.ACCESS_TOKEN}}
branch: dev
- name: "Sign release"
if: ${{ env.new_commit == 'true' }}
uses: ilharp/sign-android-release@v1
id: sign_app
with:
releaseDir: app/build/outputs/apk/release
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
buildToolsVersion: 33.0.0
- name: "Rename apk"
if: ${{ env.new_commit == 'true' }}
id: rename_apk
run: |
mv "${{steps.sign_app.outputs.signedFile}}" "app/build/outputs/apk/release/NewPipe_${{steps.tagger.outputs.new_tag}}.apk"
echo "::set-output name=apkFile::app/build/outputs/apk/release/NewPipe_${{steps.tagger.outputs.new_tag}}.apk"
- name: "Create GitHub release with APK"
if: ${{ env.new_commit == 'true' }}
uses: softprops/action-gh-release@v1
id: create_release
with:
tag_name: ${{ steps.tagger.outputs.new_tag }}
target_commitish: dev
files: |
${{steps.rename_apk.outputs.apkFile}}