-
Notifications
You must be signed in to change notification settings - Fork 22
52 lines (49 loc) · 1.66 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
name: Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Keystore
run: |
echo "${{ secrets.KEYSTORE }}" > release.b64
base64 -d release.b64 > release.keystore
- name: Create Version Code
id: version_code
run: |
git checkout master
echo "value=$(git rev-list --count HEAD)" >>$GITHUB_OUTPUT
echo "VERSION_CODE $(git rev-list --count HEAD)"
- name: Build Application
run: |
./gradlew clean assembleRelease \
-PKEYSTORE=../release.keystore \
-PKEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \
-PKEY_ALIAS=${{ secrets.KEY_ALIAS }} \
-PKEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \
-PRELEASE_MAPS_API_KEY=${{ secrets.MAPS_API_KEY }} \
-PVERSION_CODE=${{ steps.version_code.outputs.value }}
- name: Get Upload URL
id: url
run: |
url="https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${GITHUB_REF#refs/tags/}"
echo "upload_url=$(curl -sL $url | jq -r '.upload_url')" >>$GITHUB_OUTPUT
- name: Upload Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.upload_url }}
asset_path: mage/build/outputs/apk/release/mage-release.apk
asset_name: mage-release.apk
asset_content_type: application/octet-stream