Skip to content

Commit 6afc7bd

Browse files
committed
### Create Pipeline
1 parent afd4ce5 commit 6afc7bd

1 file changed

Lines changed: 54 additions & 52 deletions

File tree

.github/workflows/android.yml

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,63 @@ name: Build and Release
22

33
on:
44
push:
5-
branches:
6-
- master
7-
tags:
8-
- "v*"
5+
branches:
6+
- master
7+
tags:
8+
- "v*"
99

1010
jobs:
11-
apk:
12-
name: Generate APK
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout
16-
uses: actions/[email protected]
17-
- name: Setup JDK
18-
uses: actions/[email protected]
19-
with:
20-
distribution: temurin
21-
java-version: "11"
22-
- name: Decode TOKEN
11+
apk:
12+
name: Generate APK
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/[email protected]
17+
- name: Setup JDK
18+
uses: actions/[email protected]
19+
with:
20+
distribution: temurin
21+
java-version: "11"
22+
- name: Set execution flag for gradlew
23+
run: chmod +x gradlew
24+
- name: Touch local properties
25+
run: touch local.properties
26+
- name: Get TOKEN from Secret
2327
env:
2428
TOKEN: ${{ secrets.TOKEN }}
2529
run: echo TOKEN="$TOKEN" > ./local.properties
26-
- name: Set execution flag for gradlew
27-
run: chmod +x gradlew
28-
- name: Build APK
29-
run: bash ./gradlew assembleDebug --stacktrace
30-
- name: Upload APK
31-
uses: actions/upload-artifact@v1
32-
with:
33-
name: apk
34-
path: app/build/outputs/apk/debug/app-debug.apk
30+
- name: Build APK
31+
run: bash ./gradlew assembleDebug --stacktrace
32+
- name: Upload APK
33+
uses: actions/upload-artifact@v1
34+
with:
35+
name: apk
36+
path: app/build/outputs/apk/debug/app-debug.apk
3537

36-
release:
37-
name: Release APK
38-
needs: apk
39-
runs-on: ubuntu-latest
40-
steps:
41-
- name: Download APK from build
42-
uses: actions/download-artifact@v1
43-
with:
44-
name: apk
45-
- name: Create Release
46-
id: create_release
47-
uses: actions/create-release@v1
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
with:
51-
tag_name: ${{ github.run_number }}
52-
release_name: ${{ github.event.repository.name }} v${{ github.run_number }}
53-
- name: Upload Release APK
54-
id: upload_release_asset
55-
uses: actions/[email protected]
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
with:
59-
upload_url: ${{ steps.create_release.outputs.upload_url }}
60-
asset_path: apk/app-debug.apk
61-
asset_name: ${{ github.event.repository.name }}.apk
62-
asset_content_type: application/zip
38+
release:
39+
name: Release APK
40+
needs: apk
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Download APK from build
44+
uses: actions/download-artifact@v1
45+
with:
46+
name: apk
47+
- name: Create Release
48+
id: create_release
49+
uses: actions/create-release@v1
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
tag_name: ${{ github.run_number }}
54+
release_name: ${{ github.event.repository.name }} v${{ github.run_number }}
55+
- name: Upload Release APK
56+
id: upload_release_asset
57+
uses: actions/[email protected]
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
upload_url: ${{ steps.create_release.outputs.upload_url }}
62+
asset_path: apk/app-debug.apk
63+
asset_name: ${{ github.event.repository.name }}.apk
64+
asset_content_type: application/zip

0 commit comments

Comments
 (0)