Skip to content

Build Release APK

Build Release APK #10

Workflow file for this run

name: Build Release APK
on:
workflow_dispatch:
inputs:
release_tag:
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android environment
uses: android-actions/setup-android@v3
- name: download latest Mahsa-core aar
uses: robinraju/release-downloader@v1
with:
repository: 'GFW-knocker/AndroidLibXrayLite'
latest: true
fileName: 'libv2ray.aar'
out-file-path: '${{ github.workspace }}/V2rayNG/app/libs/'
- name: Decode Keystore
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
run: |
echo $ENCODED_KEYSTORE | base64 -di > keystore.jks
- name: Build Unsiged APK
run: |
cd ${{ github.workspace }}/V2rayNG
chmod 755 gradlew
./gradlew assembleRelease
- name: check filenames
run: |
cd ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/release/
ls
- name: Sign app APK
uses: r0adkll/sign-android-release@v1
# ID used to access action output
id: sign_app
with:
releaseDirectory: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/release/
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
# override default build-tools version (33.0.0) -- optional
BUILD_TOOLS_VERSION: "34.0.0"
- name: check filenames
run: |
cd ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/release/
ls
- name: Upload NikaNG to release
uses: svenstaro/upload-release-action@v2
with:
file: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/release/*signed.apk
tag: ${{ github.event.inputs.release_tag }}
file_glob: true