Skip to content

Commit

Permalink
Merge pull request #132 from Tribler/feature/build_apk_action
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a authored Mar 2, 2023
2 parents ec89e77 + 2ff6cf2 commit 8ca402f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 17 deletions.
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

0 comments on commit 8ca402f

Please sign in to comment.