-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try creating a universal macOS binary
- Loading branch information
Showing
1 changed file
with
58 additions
and
4 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 |
---|---|---|
|
@@ -13,10 +13,6 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macOS-latest | ||
uploaded_filename: sbtn-x86_64-apple-darwin | ||
local_path: client/target/bin/sbtn | ||
jobtype: 1 | ||
- os: ubuntu-20.04 | ||
uploaded_filename: sbtn-x86_64-pc-linux | ||
local_path: client/target/bin/sbtn | ||
|
@@ -36,6 +32,7 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
repository: sbt/sbt | ||
# Make sure the native-image-macos is also updated | ||
ref: 1.9.x | ||
- name: Setup JDK | ||
uses: actions/setup-java@v3 | ||
|
@@ -92,3 +89,60 @@ jobs: | |
asset_path: ${{ matrix.local_path }} | ||
asset_name: ${{ matrix.uploaded_filename }} | ||
asset_content_type: application/zip | ||
|
||
native-image-macos: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macOS-latest | ||
uploaded_filename: sbtn-x86_64-apple-darwin | ||
local_path: target/bin/sbtn | ||
env: | ||
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M | ||
steps: | ||
- name: Checkout sbt/sbt | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: sbt/sbt | ||
ref: 1.9.x | ||
- name: Setup JDK | ||
uses: actions/setup-java@v3 | ||
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) | ||
mkdir -p target/bin/ | ||
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 target/bin/sbtn-aarch64-apple-darwin | ||
sbt clean nativeImage | ||
lipo -create -o target/bin/sbtn "client/target/bin/sbtn" "target/bin/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/[email protected] | ||
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 |