From 6d2dd5ececf75ef61e3154c2db33ae59b92c5b1b Mon Sep 17 00:00:00 2001 From: HyukWoo Park Date: Tue, 5 Nov 2024 16:58:13 +0900 Subject: [PATCH] Update release actions Signed-off-by: HyukWoo Park --- .github/workflows/android-release.yml | 28 +++++++++++------------ .github/workflows/release.yml | 33 ++++++--------------------- build/android/escargot/build.gradle | 13 +++++++++-- 3 files changed, 31 insertions(+), 43 deletions(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index aee6cf843..ff4cd1cd1 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -1,10 +1,9 @@ name: Android-Release on: - schedule: - # scheduled to run UTC 22:00 (07:00 in South Korea), Every 1st of the month - - cron: '0 22 1 * *' - workflow_dispatch: + push: + tags: + - "v*.*.*" jobs: build-android-on-ubuntu: @@ -37,7 +36,6 @@ jobs: ./build/android/escargot/build/**/escargot-*.jar !./build/android/escargot/build/**/escargot-*Shell.aar if-no-files-found: error - overwrite: true build-android-on-macos: runs-on: macos-13 @@ -45,6 +43,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: true + - name: Install Packages + run: | + brew update + brew install ninja pkg-config icu4c - name: Set up JDK uses: actions/setup-java@v4.1.0 with: @@ -65,9 +67,8 @@ jobs: path: | ./build/android/escargot/build/libs/escargot-mac.jar if-no-files-found: error - overwrite: true - merge-upload-release: + merge-update-release: needs: [build-android-on-ubuntu, build-android-on-macos] runs-on: ubuntu-latest steps: @@ -88,12 +89,9 @@ jobs: find . -type f -name "escargot-*.aar" -exec mv {} . \; find . -type f -name "escargot-*.jar" -exec mv {} . \; ls -R ./ - - name: Upload final artifacts - uses: actions/upload-artifact@v4 + find ./ -type f -name "escargot-*.aar" -o -name "escargot-*.jar" | zip Android-Release-${{ env.RELEASE_DATE }}.zip -@ + - name: Upload to release + uses: softprops/action-gh-release@v2 with: - name: Android-Release-${{ env.RELEASE_DATE }} - path: | - ./artifacts/escargot-*.aar - ./artifacts/escargot-*.jar - if-no-files-found: error - overwrite: true + files: | + artifacts/Android-Release-${{ env.RELEASE_DATE }}.zip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4523451ad..7a2019618 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: - name: Upload uses: actions/upload-artifact@v4 with: - name: mac64-result + name: build-artifact-mac64 path: out/escargot-mac64 build-mac64arm: @@ -69,7 +69,7 @@ jobs: - name: Upload uses: actions/upload-artifact@v4 with: - name: mac64arm-result + name: build-artifact-mac64arm path: out/escargot-mac64arm build-windows: @@ -115,7 +115,7 @@ jobs: - name: Upload uses: actions/upload-artifact@v4 with: - name: win-${{ matrix.arch }}-result + name: build-artifact-win-${{ matrix.arch }} path: out\escargot-win-${{ matrix.arch }}.exe build-linux: @@ -155,38 +155,19 @@ jobs: - name: Upload uses: actions/upload-artifact@v4 with: - name: linux-result + name: build-artifact-linux path: out/escargot-linux-* update-release: needs: [build-mac64, build-mac64arm, build-windows, build-linux] runs-on: ubuntu-latest steps: - - name: Download mac64 result + - name: Download build artifacts uses: actions/download-artifact@v4 with: - name: mac64-result - path: artifacts - - name: Download mac64arm result - uses: actions/download-artifact@v4 - with: - name: mac64arm-result - path: artifacts - - name: Download win32 result - uses: actions/download-artifact@v4 - with: - name: win-x86-result - path: artifacts - - name: Download win64 result - uses: actions/download-artifact@v4 - with: - name: win-x64-result - path: artifacts - - name: Download linux result - uses: actions/download-artifact@v4 - with: - name: linux-result path: artifacts + pattern: build-artifact-* + merge-multiple: true - name: Upload to release uses: softprops/action-gh-release@v2 with: diff --git a/build/android/escargot/build.gradle b/build/android/escargot/build.gradle index 876ba479c..37be2b7a5 100644 --- a/build/android/escargot/build.gradle +++ b/build/android/escargot/build.gradle @@ -110,8 +110,17 @@ task buildCMakeNativeNoNDK(type: Exec) { } os.toString().trim() } - environment("PKG_CONFIG_PATH", "/usr/local/opt/icu4c/lib/pkgconfig") - commandLine "/usr/bin/env", "cmake", "-DESCARGOT_HOST=darwin", "-DESCARGOT_ARCH=x64", "-DESCARGOT_OUTPUT=static_lib", "-DUNDER_NDK=OFF", "-DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF", + var icu4cPath = new ByteArrayOutputStream().withStream { os -> + exec { + commandLine "sh", "-c", "brew --prefix icu4c" + standardOutput = os + } + os.toString().trim() + } + var pkgConfigPath = icu4cPath + "/lib/pkgconfig" + environment("PKG_CONFIG_PATH", pkgConfigPath) + commandLine "/usr/bin/env", "cmake", "-DESCARGOT_HOST=darwin", "-DESCARGOT_ARCH=x64", "-DESCARGOT_OUTPUT=static_lib", "-DUNDER_NDK=OFF", + "-DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF", "-DJAVA_HOME=" + javaHome, "-DJAVA_INCLUDE_PATH=" + javaHome + "/include", "-DJAVA_INCLUDE_PATH2=" + javaHome + "/include/darwin", "-DJAVA_AWT_INCLUDE_PATH=" + javaHome + "/include", srcForNativeNoNDK.absolutePath