-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 2.01 KB
/
release.yml
File metadata and controls
68 lines (56 loc) · 2.01 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-release:
name: Build release APK
runs-on: ubuntu-latest
environment: release
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Decode release keystore
if: ${{ env.SIGNING_KEYSTORE_BASE64 != '' }}
env:
SIGNING_KEYSTORE_BASE64: ${{ secrets.SIGNING_KEYSTORE_BASE64 }}
run: |
echo "$SIGNING_KEYSTORE_BASE64" | base64 -d > "${{ runner.temp }}/release.keystore"
- name: Build release APK
env:
SIGNING_KEYSTORE_PATH: ${{ secrets.SIGNING_KEYSTORE_BASE64 != '' && format('{0}/release.keystore', runner.temp) || '' }}
SIGNING_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
run: ./gradlew assembleRelease --no-daemon
- name: Rename APK with version tag
run: |
mkdir -p artifacts
cp app/build/outputs/apk/release/*.apk "artifacts/SleepTimer-${{ github.ref_name }}.apk"
- name: Upload APK as workflow artifact
uses: actions/upload-artifact@v4
with:
name: SleepTimer-${{ github.ref_name }}
path: artifacts/SleepTimer-${{ github.ref_name }}.apk
if-no-files-found: error
retention-days: 90
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: artifacts/SleepTimer-${{ github.ref_name }}.apk
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}