-
Notifications
You must be signed in to change notification settings - Fork 25
66 lines (54 loc) · 2.27 KB
/
build.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
name: Build Apk
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Sign with debug key
run: |
sed -i "19i signingConfig signingConfigs.debug" ./app/build.gradle
curl -so- https://raw.githubusercontent.com/artem-zinnatullin/RxJavaProGuardRules/master/rxjava-proguard-rules/proguard-rules.txt | tee -a ./app/proguard-rules.pro
cat ./app/proguard-rules.pro
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Build debug APK
run: ./gradlew assembleDebug --stacktrace
- name: Get App Version Name
id: version
run: echo "::set-output name=app_version::$(grep versionName app/build.gradle | sed -n 's/.*versionName \"\([0-9.]*\)\".*/\1/p')"
- name: Rename APK
run: mv app/build/outputs/apk/debug/app-debug.apk game-unlocker-v${{ steps.version.outputs.app_version }}.apk
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: Game Unlocker
path: game-unlocker-v${{ steps.version.outputs.app_version }}.apk
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# with:
# files: game-unlocker-v${{ steps.version.outputs.app_version }}.apk
# tag_name: ${{ steps.version.outputs.app_version }}
# release_name: ${{ steps.version.outputs.app_version }}
# prerelease: false
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload Release Assets
# run: |
# release_id=${{ steps.create_release.outputs.id }}
# asset_url=$(curl -X POST \
# -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# -H "Content-Type: application/octet-stream" \
# --data-binary "@game-unlocker-v${{ steps.version.outputs.app_version }}.apk" \
# "https://uploads.github.com/repos/${{ github.repository }}/releases/$release_id/assets?name=game-unlocker-v${{ steps.version.outputs.app_version }}.apk")
# echo "Uploaded asset: $asset_url"