-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bmax
committed
Dec 31, 2023
1 parent
2ae24c8
commit a548f7b
Showing
1 changed file
with
42 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,47 +5,71 @@ on: | |
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_call: | ||
|
||
jobs: | ||
build-apd: | ||
uses: .github/workflows/apd.yml | ||
uses: ./.github/workflows/apd.yml | ||
with: | ||
target: aarch64-linux-android | ||
|
||
build-manager: | ||
needs: build-apd | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download arm64 apd | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: apd-aarch64-linux-android | ||
path: app/libs/arm64-v8a/libapd.so | ||
- name: Generate version | ||
id: parse_version | ||
run: | | ||
COMMIT_NUM=$(git rev-list --count HEAD) | ||
VERSION=$(echo "$COMMIT_NUM + 200 + 10000" | bc) | ||
echo "Generated Version: $VERSION" | ||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
|
||
- name: Gradle build | ||
- uses: gradle/gradle-build-action@v2 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Download arm64 apd | ||
uses: actions/download-artifact@v3 | ||
with: | ||
gradle-version: current | ||
arguments: assembleRelease | ||
name: apd-aarch64-linux-android | ||
path: . | ||
|
||
- name: Copy Libs | ||
run: | | ||
mv aarch64-linux-android/release/apd app/libs/arm64-v8a/libapd.so | ||
- name: Build with Gradle | ||
run: | | ||
echo 'org.gradle.parallel=true' >> gradle.properties | ||
echo 'org.gradle.vfs.watch=true' >> gradle.properties | ||
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties | ||
echo 'android.native.buildOutput=verbose' >> gradle.properties | ||
sed -i 's/org.gradle.configuration-cache=true//g' gradle.properties | ||
./gradlew clean assembleRelease | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: APatch_apk | ||
name: APatch | ||
path: app/build/outputs/apk/release/*.apk | ||
|
||
- uses: r0adkll/sign-android-release@v1 | ||
- name: Sign Release | ||
uses: r0adkll/sign-android-release@v1 | ||
id: sign_app | ||
with: | ||
releaseDirectory: app/build/outputs/apk/release | ||
|
@@ -54,9 +78,12 @@ jobs: | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | ||
keyPassword: ${{ secrets.KEY_PASSWORD }} | ||
|
||
- uses: ncipollo/release-action@v1 | ||
- name: Release apk | ||
uses: ncipollo/[email protected] | ||
with: | ||
artifacts: ${{steps.sign_app.outputs.signedReleaseFile}} | ||
token: ${{ github.token }} | ||
tag: ${{ steps.parse_version.outputs.VERSION }} | ||
artifacts: ${{steps.sign_app.outputs.signedReleaseFile}} | ||
generateReleaseNotes: true | ||
|
||
makeLatest: true | ||
replacesArtifacts: true |