From 9a1121e143f86b519084cd66f2446c97f5b5d9a9 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Fri, 23 Feb 2024 11:45:14 +0000 Subject: [PATCH 01/18] Change CI to generate universal macos binary --- .github/workflows/native.yml | 57 ++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 8645b5f..75c9696 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -64,9 +64,12 @@ jobs: fail-fast: false matrix: include: - - os: macOS-latest + - os: macOS-12 uploaded_filename: sbtn-x86_64-apple-darwin local_path: target/bin/sbtn + - os: macOS-14 + uploaded_filename: sbtn-aarch64-apple-darwin + local_path: target/bin/sbtn env: JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M steps: @@ -80,31 +83,54 @@ jobs: with: distribution: temurin java-version: 8 + - run: git fetch --tags || true - - name: Build - if: github.event_name == 'release' - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo $(pwd) - curl -L "https://github.com/sbt/sbtn-dist/releases/download/${{ github.event.release.tag_name }}/sbtn-aarch64-apple-darwin" \ - --header "Authorization: token $GITHUB_TOKEN" \ - --output sbtn-aarch64-apple-darwin \ - --fail - sbt clean nativeImage - mkdir -p target/bin - lipo -create -o target/bin/sbtn "client/target/bin/sbtn" "sbtn-aarch64-apple-darwin" + - name: Build if: github.event_name != 'release' shell: bash run: | echo $(pwd) sbt clean nativeImage + - uses: actions/upload-artifact@v3 with: path: ${{ matrix.local_path }} name: ${{ matrix.uploaded_filename }} + + - name: Upload release + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ matrix.local_path }} + asset_name: ${{ matrix.uploaded_filename }} + asset_content_type: application/zip + + + native-image-universal-macos: + needs: native-image-macos + runs-on: macos-14 + steps: + - name: Download binaries + uses: actions/download-artifact@v4 + id: download + + - name: Build universal binary + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p target/bin + lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/**/*-apple-darwin" + + - uses: actions/upload-artifact@v3 + with: + path: target/bin/sbtn + name: sbtn-universal-apple-darwin + - name: Upload release if: github.event_name == 'release' uses: actions/upload-release-asset@v1.0.2 @@ -116,6 +142,7 @@ jobs: asset_name: ${{ matrix.uploaded_filename }} asset_content_type: application/zip + native-image-aarch64-pc-linux-linux: runs-on: ${{ matrix.os }} strategy: From 92d195c19e1c8aee8cfa243c228a0d346a83e840 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Fri, 23 Feb 2024 11:46:28 +0000 Subject: [PATCH 02/18] Remove cirrus --- .cirrus.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index a55c8bb..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,14 +0,0 @@ -task: - name: Build sbtn for macOS ARM64 - macos_instance: - image: ghcr.io/cirruslabs/macos-ventura-base:latest - coursier_cache: - folder: $HOME/Library/Caches/Coursier/v1 - sbt_cache: - folder: $HOME/.sbt - build_script: arch -arm64 ./.cirrus/publish-macos-silicon.sh - binary_artifacts: - name: Binary assets - path: "sbt/client/target/bin/sbtn" - env: - GITHUB_TOKEN: ENCRYPTED[65efb285fa4586596a40dff7835359454c641657b6496e394d8c8b00f01700755e23ea6b1e12fb248260213129b33c9e] From 0f643004debec8a9948237cacc8ffe5b64ec0833 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 14:41:48 -0500 Subject: [PATCH 03/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 75c9696..bb160d4 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -82,7 +82,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: temurin - java-version: 8 + java-version: 17 - run: git fetch --tags || true From bf5397419189671184aef16b0d5a76a14a521c93 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 14:54:38 -0500 Subject: [PATCH 04/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index bb160d4..6f8e8d9 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -91,6 +91,7 @@ jobs: shell: bash run: | echo $(pwd) + curl -sL https://raw.githubusercontent.com/sbt/sbt/v1.9.9/sbt > $HOME/bin/sbt sbt clean nativeImage - uses: actions/upload-artifact@v3 From a41d86d8270b93c812f412d41ca5ea0cc984a0c5 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 15:04:07 -0500 Subject: [PATCH 05/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 6f8e8d9..714eb48 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -91,7 +91,8 @@ jobs: shell: bash run: | echo $(pwd) - curl -sL https://raw.githubusercontent.com/sbt/sbt/v1.9.9/sbt > $HOME/bin/sbt + curl -sL https://raw.githubusercontent.com/sbt/sbt/v1.9.9/sbt > /Users/runner/bin/sbt + chmod +x /Users/runner/bin/sbt sbt clean nativeImage - uses: actions/upload-artifact@v3 From 09953e1cc64155634f9f440b074d103fbcbe98de Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 15:19:18 -0500 Subject: [PATCH 06/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 714eb48..f9188b1 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -91,7 +91,9 @@ jobs: shell: bash run: | echo $(pwd) + mkdir -p $HOME/bin/ curl -sL https://raw.githubusercontent.com/sbt/sbt/v1.9.9/sbt > /Users/runner/bin/sbt + export PATH="$PATH:$HOME/bin" chmod +x /Users/runner/bin/sbt sbt clean nativeImage From 76f690b208f8ab0fc91fc89a08586f1d3916a108 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 15:37:45 -0500 Subject: [PATCH 07/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index f9188b1..177d3fb 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -91,10 +91,10 @@ jobs: shell: bash run: | echo $(pwd) - mkdir -p $HOME/bin/ - curl -sL https://raw.githubusercontent.com/sbt/sbt/v1.9.9/sbt > /Users/runner/bin/sbt + mkdir -p "$HOME/bin/" + curl -sL https://raw.githubusercontent.com/sbt/sbt/v1.9.9/sbt > "$HOME/bin/sbt" export PATH="$PATH:$HOME/bin" - chmod +x /Users/runner/bin/sbt + chmod +x "$HOME/bin/sbt" sbt clean nativeImage - uses: actions/upload-artifact@v3 From ffd641cf5a67da12dd35fea207a0c85161353db4 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 15:49:58 -0500 Subject: [PATCH 08/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 177d3fb..1944065 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -66,7 +66,7 @@ jobs: include: - os: macOS-12 uploaded_filename: sbtn-x86_64-apple-darwin - local_path: target/bin/sbtn + local_path: client/target/bin/sbtn - os: macOS-14 uploaded_filename: sbtn-aarch64-apple-darwin local_path: target/bin/sbtn From 85ec4d9dde17011e3fa3587debc548deb90643df Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 15:50:08 -0500 Subject: [PATCH 09/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 1944065..2a25516 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -69,7 +69,7 @@ jobs: local_path: client/target/bin/sbtn - os: macOS-14 uploaded_filename: sbtn-aarch64-apple-darwin - local_path: target/bin/sbtn + local_path: client/target/bin/sbtn env: JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M steps: From de1e9a70b7ad4cb9ce79bd77c2554a721436c9ee Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 17:33:39 -0500 Subject: [PATCH 10/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 2a25516..d56e7ca 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -97,7 +97,7 @@ jobs: chmod +x "$HOME/bin/sbt" sbt clean nativeImage - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: ${{ matrix.local_path }} name: ${{ matrix.uploaded_filename }} From e89b8967f99fde4b698ba043f6383e5de0205ed3 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 17:46:28 -0500 Subject: [PATCH 11/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index d56e7ca..942b349 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -128,7 +128,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p target/bin - lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/**/*-apple-darwin" + lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/*-apple-darwin" - uses: actions/upload-artifact@v3 with: From 1b46d3abb6f9adf5ecf2b58f8b4b1c7b8581dfdd Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 18:06:29 -0500 Subject: [PATCH 12/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 942b349..a772730 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -128,7 +128,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p target/bin - lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/*-apple-darwin" + lipo -create -o target/bin/sbtn "sbtn-x86_64-apple-darwin" "sbtn-aarch64-apple-darwin" - uses: actions/upload-artifact@v3 with: From 75a8352807c02feb4b6ff2c614fa128226b4ae06 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 18:38:46 -0500 Subject: [PATCH 13/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index a772730..4c646e8 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -128,7 +128,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p target/bin - lipo -create -o target/bin/sbtn "sbtn-x86_64-apple-darwin" "sbtn-aarch64-apple-darwin" + lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/sbtn-x86_64-apple-darwin" "${{steps.download.outputs.download-path}}/sbtn-aarch64-apple-darwin" - uses: actions/upload-artifact@v3 with: From f7969747e59e85606b3b5a3033915657bae4492a Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 19:52:38 -0500 Subject: [PATCH 14/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 4c646e8..5854294 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -116,7 +116,7 @@ jobs: native-image-universal-macos: needs: native-image-macos - runs-on: macos-14 + runs-on: macos-12 steps: - name: Download binaries uses: actions/download-artifact@v4 From 5498d4dfdd96d3a4bd34f43f2f45a6dc2cbccf9d Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 22:37:28 -0500 Subject: [PATCH 15/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 5854294..ab7841b 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -120,7 +120,9 @@ jobs: steps: - name: Download binaries uses: actions/download-artifact@v4 - id: download + merge-multiple: true + - name: Display structure of downloaded files + run: ls -R - name: Build universal binary shell: bash From b4cab3ae0d320b7f5a73d73863a74bb7a1548d92 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 22:40:04 -0500 Subject: [PATCH 16/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index ab7841b..b55342a 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -120,7 +120,8 @@ jobs: steps: - name: Download binaries uses: actions/download-artifact@v4 - merge-multiple: true + with: + merge-multiple: true - name: Display structure of downloaded files run: ls -R From 1eed9be389debfa82eed4cdce7504f0ddcdba3fe Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 23:01:17 -0500 Subject: [PATCH 17/18] Apply suggestions from code review --- .github/workflows/native.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index b55342a..9386e70 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -120,8 +120,6 @@ jobs: steps: - name: Download binaries uses: actions/download-artifact@v4 - with: - merge-multiple: true - name: Display structure of downloaded files run: ls -R @@ -131,7 +129,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p target/bin - lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/sbtn-x86_64-apple-darwin" "${{steps.download.outputs.download-path}}/sbtn-aarch64-apple-darwin" + lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/sbtn-x86_64-apple-darwin/sbtn" "${{steps.download.outputs.download-path}}/sbtn-aarch64-apple-darwin/sbtn" - uses: actions/upload-artifact@v3 with: From 7391108c02f67e12f8cc2b77c90e231033ebb1ea Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Fri, 23 Feb 2024 23:18:18 -0500 Subject: [PATCH 18/18] Update .github/workflows/native.yml --- .github/workflows/native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 9386e70..d8c8e1a 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -129,7 +129,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p target/bin - lipo -create -o target/bin/sbtn "${{steps.download.outputs.download-path}}/sbtn-x86_64-apple-darwin/sbtn" "${{steps.download.outputs.download-path}}/sbtn-aarch64-apple-darwin/sbtn" + lipo -create -o target/bin/sbtn "sbtn-x86_64-apple-darwin/sbtn" "sbtn-aarch64-apple-darwin/sbtn" - uses: actions/upload-artifact@v3 with: