From 46f455e4baaedc75113ff71ef94db41c541ec91d Mon Sep 17 00:00:00 2001 From: 5ec1cff Date: Tue, 16 Jul 2024 22:37:17 +0800 Subject: [PATCH] add build actions --- .github/workflows/build.yml | 67 +++++++++++++++++++++ module/src/main/cpp/external/CMakeLists.txt | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d72ae92 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,67 @@ +name: Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Check out + uses: actions/checkout@v4 + with: + submodules: "recursive" + fetch-depth: 0 + + - name: Setup Gradle + uses: gradle/gradle-build-action@v3 + with: + gradle-home-cache-cleanup: true + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: | + yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null + ./gradlew zipRelease + ./gradlew zipDebug + + - name: Prepare artifact + if: success() + id: prepareArtifact + run: | + releaseName=`ls module/release/Tricky-Store-v*-release.zip | awk -F '(/|.zip)' '{print $3}'` && echo "releaseName=$releaseName" >> $GITHUB_OUTPUT + debugName=`ls module/release/Tricky-Store-v*-debug.zip | awk -F '(/|.zip)' '{print $3}'` && echo "debugName=$debugName" >> $GITHUB_OUTPUT + unzip module/release/Tricky-Store-v*-release.zip -d module-release + unzip module/release/Tricky-Store-v*-debug.zip -d module-debug + + - name: Upload release + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.prepareArtifact.outputs.releaseName }} + path: "./module-release/*" + + - name: Upload debug + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.prepareArtifact.outputs.debugName }} + path: "./module-debug/*" + + - name: Upload release mappings + uses: actions/upload-artifact@v4 + with: + name: release-mappings + path: "./service/build/outputs/mapping/release" diff --git a/module/src/main/cpp/external/CMakeLists.txt b/module/src/main/cpp/external/CMakeLists.txt index 89c501e..51ce573 100644 --- a/module/src/main/cpp/external/CMakeLists.txt +++ b/module/src/main/cpp/external/CMakeLists.txt @@ -9,7 +9,7 @@ endmacro() SET_OPTION(DOBBY_GENERATE_SHARED OFF) SET_OPTION(Plugin.SymbolResolver OFF) -add_subdirectory(Dobby) +add_subdirectory(dobby) target_link_libraries(dobby cxx) # end dobby