update ci build

This commit is contained in:
ShirosakiMio 2024-01-16 18:02:33 +08:00
parent 3b71912a95
commit 91d3918299
3 changed files with 15 additions and 50 deletions

View File

@ -5,6 +5,8 @@ on:
branches-ignore: branches-ignore:
- '' - ''
push: push:
tags:
- 'v*'
branches-ignore: branches-ignore:
- '' - ''
workflow_dispatch: workflow_dispatch:
@ -29,14 +31,23 @@ jobs:
with: with:
java-version: 17 java-version: 17
- name: Build debug ${{matrix.arch}} .apk - name: Build ${{matrix.arch}} .apk
run: | run: |
chmod +x gradlew chmod +x gradlew
./gradlew assembleautobuild -Darch=${{matrix.arch}} ./gradlew assemblerelease -Darch=${{matrix.arch}}
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.TOKEN }}"
files: |
FCL/build/outputs/apk/release/*.apk
- name: upload apk - name: upload apk
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: app-debug-${{matrix.arch}} name: app-${{matrix.arch}}
path: FCL/build/outputs/apk/autobuild/* path: FCL/build/outputs/apk/release/*
# retention-days: 1 # retention-days: 1

View File

@ -1,42 +0,0 @@
name: Release new version
on:
push:
tags:
- 'v*'
branches-ignore:
- ''
workflow_dispatch:
jobs:
build:
strategy:
matrix:
arch: [ "all", "arm", "arm64", "x86", "x64" ]
fail-fast: false
env:
FCL_KEYSTORE_PASSWORD: ${{ secrets.FCL_KEYSTORE_PASSWORD }}
name: Build for ${{matrix.arch}}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Build release ${{matrix.arch}} .apk
run: |
chmod +x gradlew
./gradlew assemblerelease -Darch=${{matrix.arch}}
- name: Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.TOKEN }}"
prerelease: false
files: |
FCL/build/outputs/apk/release/*.apk

View File

@ -38,10 +38,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.FCLKey signingConfig signingConfigs.FCLKey
} }
autobuild {
initWith debug
signingConfig signingConfigs.FCLKey
}
configureEach { configureEach {
resValue "string", "app_version", "${defaultConfig.versionName}" resValue "string", "app_version", "${defaultConfig.versionName}"
} }