Skip to content

Merge pull request #4892 from berty/dependabot/npm_and_yarn/js/web/na… #8

Merge pull request #4892 from berty/dependabot/npm_and_yarn/js/web/na…

Merge pull request #4892 from berty/dependabot/npm_and_yarn/js/web/na… #8

Workflow file for this run

name: Android
on:
push:
tags:
- v*
branches:
- master
paths:
- "go/**"
- "!go/**.md"
- "go.*"
- "**.go"
- "js/**"
- ".github/workflows/android.yml"
pull_request:
paths:
- "go/**"
- "!go/**.md"
- "go.*"
- "**.go"
- "js/**"
- "!js/packages/i18n/locale/*/*.json"
- ".github/workflows/android.yml"
jobs:
build:
name: Build for Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Load variables from file
uses: antifree/[email protected]
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@v1
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Setup node
run: |
asdf plugin add nodejs
asdf install nodejs
echo "node_version=$(asdf current nodejs | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Setup yarn
run: |
asdf plugin add yarn
asdf install yarn
- name: Setup java
run: |
asdf plugin add java
asdf install java
- name: Cache go modules
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('go/**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Cache node modules
uses: actions/[email protected]
with:
path: js/node_modules
key: ${{ runner.OS }}-node-${{ env.node_version }}-${{ env.json_cache-versions_node }}-${{ hashFiles('js/yarn.lock') }}
restore-keys: ${{ runner.OS }}-node-${{ env.node_version }}-${{ env.json_cache-versions_node }}-
- name: Cache gobridge aar
uses: n0izn0iz/mkache@5cedaeaf0b39a9220ae5a815cac8d2a924cee3ef
if: github.ref != 'refs/heads/master' # this makes sure the VCS_REF is correct on master
with:
rule: android/libs/gobridge.aar
makefile: js/Makefile
key: android-gomobile-bridge-${{ matrix.golang }}
- name: Fetch node modules
working-directory: js
run: make node_modules
- name: Build gobridge aar
working-directory: js
run: make android.gomobile
- name: Build the APK
working-directory: js
env:
CI: "true"
run: |
make android.app_deps
(yarn jetify && cd android && ./gradlew -i app:bundleReleaseYolo)
### TODO: move this part on Yolo and use release keystore ###
mkdir -p $HOME/.android
cp android/app/debug.keystore $HOME/.android
wget \
https://github.com/google/bundletool/releases/download/1.8.2/bundletool-all-1.8.2.jar \
-O /tmp/bundletool.jar
java -jar /tmp/bundletool.jar build-apks \
--bundle=android/app/build/outputs/bundle/releaseYolo/app-releaseYolo.aab \
--output=${{ github.workspace }}/app.apks \
--mode=universal
cd ${{ github.workspace }} && unzip app.apks
################################################
- name: Upload the APK
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/universal.apk
name: berty-universal-${{github.sha}}.apk
if-no-files-found: error