Skip to content

Commit 0201e3f

Browse files
committed
add support for nighlty-new-compiler
1 parent 48dfaeb commit 0201e3f

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
arch: x86_64
2323
runner: ubuntu-latest
2424
version: nightly
25+
- os: Linux
26+
arch: x86_64
27+
runner: ubuntu-latest
28+
version: nightly-new-compiler
2529
- os: Linux
2630
arch: arm64
2731
runner: ubuntu-24.04-arm
@@ -34,6 +38,10 @@ jobs:
3438
arch: arm64
3539
runner: ubuntu-24.04-arm
3640
version: nightly
41+
- os: Linux
42+
arch: arm64
43+
runner: ubuntu-24.04-arm
44+
version: nightly-new-compiler
3745
- os: macOS
3846
arch: x86_64
3947
runner: macos-15-intel
@@ -46,6 +54,10 @@ jobs:
4654
arch: x86_64
4755
runner: macos-15-intel
4856
version: nightly
57+
- os: macOS
58+
arch: x86_64
59+
runner: macos-15-intel
60+
version: nightly-new-compiler
4961
- os: macOS
5062
arch: arm64
5163
runner: macos-latest
@@ -58,6 +70,10 @@ jobs:
5870
arch: arm64
5971
runner: macos-latest
6072
version: nightly
73+
- os: macOS
74+
arch: arm64
75+
runner: macos-latest
76+
version: nightly-new-compiler
6177

6278
steps:
6379
- name: Checkout repository
@@ -71,8 +87,13 @@ jobs:
7187
- name: Check Roc version
7288
run: roc version
7389

74-
- name: Download HelloWorld example
90+
- name: Download HelloWorld example (old compiler)
91+
if: matrix.version != 'nightly-new-compiler'
7592
run: curl -fsSL -o main.roc https://raw.githubusercontent.com/roc-lang/examples/main/examples/HelloWorld/main.roc
7693

94+
- name: Download HelloWorld example (new compiler)
95+
if: matrix.version == 'nightly-new-compiler'
96+
run: curl -fsSL -o main.roc https://raw.githubusercontent.com/roc-lang/nightlies/main/hello_world_test.roc
97+
7798
- name: Run HelloWorld example
7899
run: roc main.roc

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ Add this step to your CI workflow:
2929
version: nightly
3030
```
3131
32+
### Using New Compiler Nightly Releases
33+
34+
```yaml
35+
- uses: roc-lang/setup-roc@TODO
36+
with:
37+
# Installs the latest nightly from https://github.com/roc-lang/nightlies
38+
version: nightly-new-compiler
39+
```
40+
3241
## Platform Support
3342
3443
This action supports the following platforms:

action.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ branding:
66

77
inputs:
88
version:
9-
description: 'Version of Roc to install (e.g., "nightly", "alpha4-rolling")'
9+
description: 'Version of Roc to install (e.g., "nightly", "nightly-new-compiler", "alpha4-rolling")'
1010
required: true
1111

1212
runs:
@@ -97,20 +97,33 @@ runs:
9797
alpha4-rolling-macos_apple_silicon)
9898
EXPECTED_SHA="416fbd983280eda11ac87b0947e27bf0a86d186a94baebeb71e163942bb5bd84"
9999
;;
100+
nightly-new-compiler-*)
101+
# New compiler nightly builds - no SHA verification
102+
;;
100103
nightly-*)
101104
# Nightly builds - no SHA verification
102105
;;
103106
*)
104107
echo "Error: Unsupported version: $VERSION"
105-
echo "Supported versions: nightly, alpha3-rolling, alpha4-rolling"
108+
echo "Supported versions: nightly, nightly-new-compiler, alpha3-rolling, alpha4-rolling"
106109
echo "Make sure your version is listed in https://github.com/roc-lang/roc/tags and try updating to"
107110
echo "the latest commit of the setup-roc action, see <https://github.com/roc-lang/setup-roc>."
108111
exit 1
109112
;;
110113
esac
111114
112115
# Download Roc
113-
if [[ "$VERSION" == "nightly" ]]; then
116+
if [[ "$VERSION" == "nightly-new-compiler" ]]; then
117+
# Fetch the latest release from roc-lang/nightlies and find the asset for our platform
118+
DOWNLOAD_URL=$(curl -fsSL "https://api.github.com/repos/roc-lang/nightlies/releases/latest" | \
119+
jq -r ".assets[] | select(.name | contains(\"${PLATFORM}\")) | select(.name | endswith(\".tar.gz\")) | .browser_download_url")
120+
if [[ -z "$DOWNLOAD_URL" ]]; then
121+
echo "Error: Could not find a nightly-new-compiler release for platform: $PLATFORM"
122+
exit 1
123+
fi
124+
SKIP_SHA_CHECK=true
125+
DIR_PATTERN="roc_nightly-${PLATFORM}-*"
126+
elif [[ "$VERSION" == "nightly" ]]; then
114127
DOWNLOAD_URL="https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-${PLATFORM}-latest.tar.gz"
115128
SKIP_SHA_CHECK=true
116129
DIR_PATTERN="roc_nightly-${PLATFORM}-*"

0 commit comments

Comments
 (0)