Skip to content

Release

Release #18

Workflow file for this run

name: Release
on:
push:
branches:
- "master"
paths:
- "CHANGELOG.md"
workflow_dispatch:
jobs:
android:
runs-on: ubuntu-latest
env:
output: "${{ github.workspace }}/build/app/outputs/apk/release"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download AList Source Code
run: |
cd $GITHUB_WORKSPACE/alist-lib/scripts
chmod +x *.sh
./init_alist.sh
./init_web.sh
- uses: actions/setup-go@v5
with:
go-version: 1.22
cache-dependency-path: ${{ github.workspace }}/alist-lib/alist/go.sum
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Build AList
run: |
cd $GITHUB_WORKSPACE/alist-lib/scripts
chmod +x *.sh
./init_gomobile.sh
./gobind.sh
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Upload AAR
uses: actions/upload-artifact@v3
with:
name: "AList"
path: "${{ github.workspace }}/android/app/libs/*.aar"
- name: Init Signature
run: |
touch local.properties
cd android
echo ALIAS_NAME='${{ secrets.ALIAS_NAME }}' >> local.properties
echo ALIAS_PASSWORD='${{ secrets.ALIAS_PASSWORD }}' >> local.properties
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties
echo KEY_PATH='./key.jks' >> local.properties
# 从Secrets读取无换行符Base64解码, 然后保存到到app/key.jks
echo ${{ secrets.KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/android/app/key.jks
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.6'
- run: flutter build apk --split-per-abi --release
- name: Upload missing_rules.txt
if: failure() && steps.gradle.outcome != 'success'
uses: actions/upload-artifact@v3
with:
name: "missing_rules"
path: "${{ github.workspace }}/build/app/outputs/mapping/release/missing_rules.txt"
- name: Init APP Version Name
run: |
echo "ver_name=$(grep -m 1 'versionName' ${{ env.output }}/output-metadata.json | cut -d\" -f4)" >> $GITHUB_ENV
- uses: softprops/action-gh-release@v1
with:
name: ${{ env.ver_name }}
tag_name: ${{ env.ver_name }}
body_path: ${{ github.workspace }}/CHANGELOG.md
draft: false
prerelease: false
files: ${{ env.output }}/*.apk
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}