Skip to content

Commit 336a2d2

Browse files
committed
Add a CI build to autopublish APKs
1 parent c0ff8b8 commit 336a2d2

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
name: Build
6+
runs-on: ubuntu-18.04
7+
steps:
8+
- uses: actions/checkout@v2
9+
10+
- name: Set up JDK 1.8
11+
uses: actions/setup-java@v1
12+
with:
13+
java-version: 1.8
14+
15+
- name: Setup Android SDK
16+
uses: android-actions/setup-android@v2
17+
18+
- name: Build release
19+
run: ./gradlew assembleRelease
20+
21+
- uses: actions/upload-artifact@v2
22+
with:
23+
name: app
24+
path: app/build/outputs/apk/release/app-release-unsigned.apk
25+
if-no-files-found: error
26+
27+
deploy:
28+
name: Deploy to GitHub Releases
29+
needs: build
30+
runs-on: ubuntu-18.04
31+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
32+
steps:
33+
- name: Get the APK
34+
id: get_apk
35+
uses: actions/download-artifact@v2
36+
with:
37+
name: app
38+
39+
- name: Publish the APK to GitHub Releases
40+
uses: svenstaro/upload-release-action@v2
41+
with:
42+
prerelease: true
43+
asset_name: pinning-demo.apk
44+
file: ${{ steps.get_apk.outputs.download-path }}/app-release-unsigned.apk
45+
tag: ${{ github.ref }}
46+
repo_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)