Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split apk.yml into master and PR #132

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/actions/checkout_submodules/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Checkout submodules
description: Checkout submodules
runs:
using: 'composite'
steps:
- shell: bash
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
40 changes: 40 additions & 0 deletions .github/workflows/apk_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build APK for master

on:
push:
branches: master

jobs:
apk:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: ./.github/actions/checkout_submodules

- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11

- name: Build release APK
run: |
echo $KEYSTORE_FILE | base64 -d > app/build.keystore
./gradlew assembleRelease \
-Pandroid.injected.signing.store.file=$(pwd)/app/build.keystore \
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
-Pandroid.injected.signing.key.alias=$KEY_ALIAS \
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
env:
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}

- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/apk/release/app-release.apk
13 changes: 3 additions & 10 deletions .github/workflows/apk.yml → .github/workflows/apk_pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: apk
name: Build APK for PR

on:
pull_request_target:
push:
branches: master

jobs:
apk:
Expand All @@ -17,13 +15,8 @@ jobs:
with:
ref: refs/pull/${{github.event.pull_request.number}}/merge

- name: Checkout submodules
shell: bash
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: ./.github/actions/checkout_submodules

- name: Setup Java
uses: actions/setup-java@v1
with:
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Checkout submodules
shell: bash
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: ./.github/actions/checkout_submodules

- name: Setup Java
uses: actions/setup-java@v1
Expand Down