Skip to content

Build APK

Build APK #4

Workflow file for this run

name: Build APK
on:
push:
tags:
- "v*.*.*"
jobs:
ci:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install depends
run: npm i
- name: Typing
run: npm run typing
- name: Test
run: npm run test
build:
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Install and Build Capacitor 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
pnpm i
pnpm build:android --ide
- name: Build Android App
uses: anime-vsub/android-build-action@1.2.1
with:
project-path: src-capacitor/android
output-path: apk-release.apk
gradle-task: assembleRelease
# build-type: bundle
# package-name: git.shin.animevsub
# keystore-content: ${{ secrets.KEYSTORE_CONTENT }}
# keystore-password: ${{ secrets.KEYSTORE_PASSWORD }}
# keystore-alias: ${{ secrets.KEYSTORE_ALIAS }}
# browserstack-upload: true
# browserstack-username: ${{ secrets.BROWSERSTACK_USERNAME }}
# browserstack-access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
# ID used to access action output
id: sign_app
with:
releaseDirectory: /home/runner/work/app/app
signingKeyBase64: ${{ secrets.KEYSTORE_CONTENT }}
alias: ${{ secrets.KEYSTORE_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEYSTORE_PASSWORD }}
env:
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION: "30.0.2"
# Example use of `signedReleaseFile` output -- not needed
- uses: actions/upload-artifact@v2
with:
name: apk-release.apk
path: ${{steps.sign_app.outputs.signedReleaseFile}}
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@c3f61b2a3db543ceee83c759ac8e48419a1a2211
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v0.1.14
with:
files: ${{steps.sign_app.outputs.signedReleaseFile}}
body: ${{ steps.changelog.outputs.changelog }}