Skip to content

Conversation

julienrf
Copy link
Contributor

This PR shows how to set up Cirrus CI to build binaries for macOS on the ARM64 architecture.

If we merge it, we will have to also install the Cirrus CI GitHub app on the sbt/sbtn-dist repo.

I could not test the release workflow. Probably we need to cut a release from the main branch? I tried to push a tag and create a GitHub release from that but that did not trigger a build on the Cirrus CI side.

Relates to sbt/sbt#7143.

Comment on lines +10 to +12
binary_artifacts:
name: Binary assets
path: "sbt/client/target/bin/sbtn"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always build the binary and export it as a downloadable asset from the Cirrus CI UI.

We also set up a few commands in the script publish-macos-silicon.sh that should publish the binary as a release asset, when the job is triggered by a release (I could not test that, though).

@@ -0,0 +1,9 @@
#!/bin/bash -ex

brew install sbt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if JDK is available, but if so I'd avoid Home Brew (this can be done post-merge).

Suggested change
brew install sbt
RUNNER_VER=1.8.2
mkdir -p $HOME/bin
export PATH="$HOME/bin:$PATH"
curl -sL https://raw.githubusercontent.com/sbt/sbt/v$RUNNER_VER/sbt > $HOME/bin/sbt

Copy link
Contributor Author

@julienrf julienrf Feb 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there is no JDK by default on the image (see here) and brew install sbt installs both sbt and a JDK. What is the issue with using brew?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I avoid it since we don't control it, and it installs a JDK as opposed to us picking a JDK explicitly. For the purpose of sbtn it probably doesn't matter much since we are launching GraalVM but normally we need to use JDK 8.

@eed3si9n
Copy link
Member

Overall LGTM

@eed3si9n
Copy link
Member

Maybe we should also move aarch64 Linux build (currently using QEMU and super slow) to Cirrus CI as well?

@julienrf julienrf marked this pull request as ready for review February 15, 2023 10:57
@julienrf julienrf marked this pull request as draft February 15, 2023 10:57
@julienrf
Copy link
Contributor Author

Maybe we should also move aarch64 Linux build (currently using QEMU and super slow) to Cirrus CI as well?

That sounds like a good idea, yes. However, I would prefer if that can be done later.

@julienrf julienrf marked this pull request as ready for review February 15, 2023 14:12
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@julienrf julienrf merged commit 8c7b069 into sbt:develop Feb 15, 2023
@julienrf julienrf deleted the try-cirrus-ci branch February 15, 2023 14:33
@julienrf
Copy link
Contributor Author

I merged it to trigger a build and I will adjust some configuration in a follow-up PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants