forked from OlauncherCF/OlauncherCF
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (113 loc) · 3.61 KB
/
release.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Build & Publish Release APK
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
changelog:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a complete changelog for repo
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
- name: Generate a changelog for f-droid
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: fastlane/metadata/android/en-US/changelogs/1.txt
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_user_name: github-actions[bot]
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: ""
commit_message: 'Update changelog'
file_pattern: CHANGELOG.md fastlane/metadata/android/en-US/changelogs/1.txt
build:
runs-on: ubuntu-latest
needs: changelog
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Make Gradle executable
run: chmod +x gradlew
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Check output
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
echo $RELEASE_VERSION
echo ${{ steps.vars.outputs.tag }}
- name: Bump version
uses: chkfung/android-version-actions@v1.2.1
with:
gradlePath: app/build.gradle # or app/build.gradle.kts
versionCode: ${{github.run_number}}
versionName: ${{env.RELEASE_VERSION}}
- name: Build APK
# run: ./gradlew assembleDebug
run: ./gradlew build
- name: Upload artifact Debug APK
uses: actions/upload-artifact@v3
with:
name: apk
path: app/build/outputs/apk/release/*.apk
# - name: Build apk
# run: ./gradlew build
# - name: Sign apk
# uses: r0adkll/sign-android-release@v1
# id: sign_app # ID used to access action output
# with:
# releaseDirectory: app/build/outputs/apk/release
# signingKeyBase64: ${{ secrets.KEY_STORE }}
# alias: ${{ secrets.ALIAS }}
# keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
# keyPassword: ${{ secrets.KEY_PASSWORD }}
# - name: Release to GitHub
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{steps.sign_app.outputs.signedReleaseFile}}
# asset_name: OlauncherCF-${{ github.ref_name }}.apk
# tag: ${{ github.ref }}
# overwrite: true
# body: "OlauncherCF.apk Release"
release:
permissions:
contents: write
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # Necessary to access local action
- name: github-action-release-apk
uses: gogoadl/github-action-release-apk@v1.0.0-alpha09
with:
asset-name: 'OlauncherCF.apk'
github-token: ${{ secrets.GITHUB_TOKEN }}
base64-keystore: ${{ secrets.KEY_STORE_BASE64 }}
key-file: ${{ secrets.KEY_STORE }}
keystore-password: ${{ secrets.KEY_STORE_PASSWORD }}
keystore-alias: ${{ secrets.ALIAS }}
key-password: ${{ secrets.KEY_PASSWORD }}