Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
strategy:
matrix:
include:
- os: Linux
arch: x86_64
runner: ubuntu-latest
version: alpha3-rolling
- os: Linux
arch: x86_64
runner: ubuntu-latest
Expand All @@ -18,6 +22,10 @@ jobs:
arch: x86_64
runner: ubuntu-latest
version: nightly
- os: Linux
arch: arm64
runner: ubuntu-24.04-arm
version: alpha3-rolling
- os: Linux
arch: arm64
runner: ubuntu-24.04-arm
Expand All @@ -26,6 +34,10 @@ jobs:
arch: arm64
runner: ubuntu-24.04-arm
version: nightly
- os: macOS
arch: x86_64
runner: macos-15-intel
version: alpha3-rolling
- os: macOS
arch: x86_64
runner: macos-15-intel
Expand All @@ -34,6 +46,10 @@ jobs:
arch: x86_64
runner: macos-15-intel
version: nightly
- os: macOS
arch: arm64
runner: macos-latest
version: alpha3-rolling
- os: macOS
arch: arm64
runner: macos-latest
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ Add this step to your CI workflow:
with:
version: alpha4-rolling
```
> Note: we recommend using this @commit-sha way to specify the version. This makes sure that the included alpha4 release sha256 hashes can not be altered if a github account with access to this repo is hacked.
> Note: we recommend using this @commit-sha way to specify the version. This makes sure that the alpha4 release can not be altered if one of our github accounts is hacked.

### Using Nightly Releases

```yaml
- uses: roc-lang/setup-roc@e2e4452c2bfb0380daadefdb23b989bc9748c63b
with:
# Nightly hashes are not verified because they are updated regularly.
version: nightly
```

Expand Down
42 changes: 38 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ runs:
case "$ARCH" in
x86_64)
PLATFORM="linux_x86_64"
EXPECTED_SHA="96e8be05e6f7176433ada74532ff36a62b8dc44c5247a82cdf919f2dadc5178b"
DIR_PATTERN="roc_nightly-linux_x86_64-*"
SHA_CMD="sha256sum"
;;
aarch64|arm64)
PLATFORM="linux_arm64"
EXPECTED_SHA="95558e2b5564b9f2b19fb29ad7df440d4ef7163dea571ffcd39409ef678ecccf"
DIR_PATTERN="roc_nightly-linux_arm64-*"
SHA_CMD="sha256sum"
;;
Expand All @@ -53,13 +51,11 @@ runs:
case "$ARCH" in
x86_64)
PLATFORM="macos_x86_64"
EXPECTED_SHA="e8378bdec9fbeaf8f7bae49159a7b43d42050b047375521799984311dcda7078"
DIR_PATTERN="roc_nightly-macos_x86_64-*"
SHA_CMD="shasum -a 256"
;;
arm64)
PLATFORM="macos_apple_silicon"
EXPECTED_SHA="416fbd983280eda11ac87b0947e27bf0a86d186a94baebeb71e163942bb5bd84"
DIR_PATTERN="roc_nightly-macos_apple_silicon-*"
SHA_CMD="shasum -a 256"
;;
Expand All @@ -75,6 +71,44 @@ runs:
;;
esac

# Set expected SHA256 based on version and platform
case "$VERSION-$PLATFORM" in
alpha3-rolling-linux_x86_64)
EXPECTED_SHA="c96045f1f54dc3d9e20c33ede8698d79b01e43f09652795beb4f0bc7fb38cba8"
;;
alpha3-rolling-linux_arm64)
EXPECTED_SHA="3eaf492e5e11d39a1c5a549005589405c40902fc0bed517acf8e8a18d190a409"
;;
alpha3-rolling-macos_x86_64)
EXPECTED_SHA="205c70d1f6f6f46c2c681350a68cd91886bdb7a24fd09646f3ba5c2b1e1e1379"
;;
alpha3-rolling-macos_apple_silicon)
EXPECTED_SHA="ef64605d0be3296ad25e34b2d6841ed506ded6208565cbd4289bc81c9dbd3c9d"
;;
alpha4-rolling-linux_x86_64)
EXPECTED_SHA="96e8be05e6f7176433ada74532ff36a62b8dc44c5247a82cdf919f2dadc5178b"
;;
alpha4-rolling-linux_arm64)
EXPECTED_SHA="95558e2b5564b9f2b19fb29ad7df440d4ef7163dea571ffcd39409ef678ecccf"
;;
alpha4-rolling-macos_x86_64)
EXPECTED_SHA="e8378bdec9fbeaf8f7bae49159a7b43d42050b047375521799984311dcda7078"
;;
alpha4-rolling-macos_apple_silicon)
EXPECTED_SHA="416fbd983280eda11ac87b0947e27bf0a86d186a94baebeb71e163942bb5bd84"
;;
nightly-*)
# Nightly builds - no SHA verification
;;
*)
echo "Error: Unsupported version: $VERSION"
echo "Supported versions: nightly, alpha3-rolling, alpha4-rolling"
echo "Make sure your version is listed in https://github.com/roc-lang/roc/tags and try updating to"
echo "the latest commit of the setup-roc action, see <https://github.com/roc-lang/setup-roc>."
exit 1
;;
esac

# Download Roc
if [[ "$VERSION" == "nightly" ]]; then
DOWNLOAD_URL="https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-${PLATFORM}-latest.tar.gz"
Expand Down