From c9f6d7ed0cc422ac4b2efd6bfa0482d6551ed96c Mon Sep 17 00:00:00 2001 From: Jing <42014615+jing332@users.noreply.github.com> Date: Sat, 24 Feb 2024 09:04:56 +0800 Subject: [PATCH] Update release.yaml --- .github/workflows/release.yaml | 61 +++++++++++----------------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d3d1b25..f369008 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,55 +9,27 @@ on: workflow_dispatch: jobs: - go: + android: runs-on: ubuntu-latest - strategy: - matrix: - GO_ARCH: [ "386", amd64, arm, arm64 ] + 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_core.sh - ./init_alist_web.sh + ./init_alist.sh + ./init_web.sh - uses: actions/setup-go@v4 with: go-version: 1.21.5 cache-dependency-path: ${{ github.workspace }}/alist-lib/alist/go.sum - - name: Build - run: | - GOARCH=${{ matrix.GO_ARCH }} - - declare -A goarch2cc=( ["arm64"]="aarch64-linux-android32-clang" ["arm"]="armv7a-linux-androideabi32-clang" ["amd64"]="x86_64-linux-android32-clang" ["386"]="i686-linux-android32-clang") - export CC="$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/${goarch2cc[$GOARCH]}" - - declare -A arch2lib=( ["arm64"]="arm64-v8a" ["arm"]="armeabi-v7a" ["amd64"]="x86_64" ["386"]="x86") - export LIB="${arch2lib[$GOARCH]}" - - cd $GITHUB_WORKSPACE/alist-lib/scripts - ./install_alist.sh $GOARCH $LIB - - - name: Upload to Artifact - uses: actions/upload-artifact@v3 - with: - name: "app_libs" - path: "${{ github.workspace }}/android/app/libs" - - android: - runs-on: ubuntu-latest - needs: [ go ] - env: - output: "${{ github.workspace }}/build/app/outputs/apk/release" - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-java@v3 with: distribution: temurin @@ -66,11 +38,18 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - - name: Download Artifact - uses: actions/download-artifact@v3 + - name: Build AList + run: | + cd $GITHUB_WORKSPACE/alist-lib/scripts + chmod +x *.sh + ./init_gomobile.sh + ./gobind.sh + + - name: Upload AAR + uses: actions/upload-artifact@v3 with: - name: "app_libs" - path: "${{ github.workspace }}/android/app/libs" + name: "AList" + path: "${{ github.workspace }}/android/app/libs/*.aar" - name: Init Signature run: | @@ -98,8 +77,8 @@ jobs: - 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@v0.1.15 + + - uses: softprops/action-gh-release@v1.1.0 with: name: ${{ env.ver_name }} tag_name: ${{ env.ver_name }}