diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce2f3ca..36cd635 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,10 @@ jobs: arch: x86_64 runner: ubuntu-latest version: nightly + - os: Linux + arch: x86_64 + runner: ubuntu-latest + version: nightly-new-compiler - os: Linux arch: arm64 runner: ubuntu-24.04-arm @@ -34,6 +38,10 @@ jobs: arch: arm64 runner: ubuntu-24.04-arm version: nightly + - os: Linux + arch: arm64 + runner: ubuntu-24.04-arm + version: nightly-new-compiler - os: macOS arch: x86_64 runner: macos-15-intel @@ -46,6 +54,10 @@ jobs: arch: x86_64 runner: macos-15-intel version: nightly + - os: macOS + arch: x86_64 + runner: macos-15-intel + version: nightly-new-compiler - os: macOS arch: arm64 runner: macos-latest @@ -58,6 +70,10 @@ jobs: arch: arm64 runner: macos-latest version: nightly + - os: macOS + arch: arm64 + runner: macos-latest + version: nightly-new-compiler steps: - name: Checkout repository @@ -71,8 +87,13 @@ jobs: - name: Check Roc version run: roc version - - name: Download HelloWorld example + - name: Download HelloWorld example (old compiler) + if: matrix.version != 'nightly-new-compiler' run: curl -fsSL -o main.roc https://raw.githubusercontent.com/roc-lang/examples/main/examples/HelloWorld/main.roc + - name: Download HelloWorld example (new compiler) + if: matrix.version == 'nightly-new-compiler' + run: curl -fsSL -o main.roc https://raw.githubusercontent.com/roc-lang/nightlies/main/hello_world_test.roc + - name: Run HelloWorld example run: roc main.roc diff --git a/README.md b/README.md index 856cd1d..b58331f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,15 @@ Add this step to your CI workflow: version: nightly ``` +### Using New Compiler Nightly Releases + +```yaml +- uses: roc-lang/setup-roc@TODO + with: + # Installs the latest nightly from https://github.com/roc-lang/nightlies + version: nightly-new-compiler +``` + ## Platform Support This action supports the following platforms: diff --git a/action.yml b/action.yml index 34ce6ba..15ad10b 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,7 @@ branding: inputs: version: - description: 'Version of Roc to install (e.g., "nightly", "alpha4-rolling")' + description: 'Version of Roc to install (e.g., "nightly", "nightly-new-compiler", "alpha4-rolling")' required: true runs: @@ -97,12 +97,15 @@ runs: alpha4-rolling-macos_apple_silicon) EXPECTED_SHA="416fbd983280eda11ac87b0947e27bf0a86d186a94baebeb71e163942bb5bd84" ;; + nightly-new-compiler-*) + # New compiler nightly builds - no SHA verification + ;; nightly-*) # Nightly builds - no SHA verification ;; *) echo "Error: Unsupported version: $VERSION" - echo "Supported versions: nightly, alpha3-rolling, alpha4-rolling" + echo "Supported versions: nightly, nightly-new-compiler, 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 ." exit 1 @@ -110,7 +113,17 @@ runs: esac # Download Roc - if [[ "$VERSION" == "nightly" ]]; then + if [[ "$VERSION" == "nightly-new-compiler" ]]; then + # Fetch the latest release from roc-lang/nightlies and find the asset for our platform + DOWNLOAD_URL=$(curl -fsSL "https://api.github.com/repos/roc-lang/nightlies/releases/latest" | \ + jq -r ".assets[] | select(.name | contains(\"${PLATFORM}\")) | select(.name | endswith(\".tar.gz\")) | .browser_download_url") + if [[ -z "$DOWNLOAD_URL" ]]; then + echo "Error: Could not find a nightly-new-compiler release for platform: $PLATFORM" + exit 1 + fi + SKIP_SHA_CHECK=true + DIR_PATTERN="roc_nightly-${PLATFORM}-*" + elif [[ "$VERSION" == "nightly" ]]; then DOWNLOAD_URL="https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-${PLATFORM}-latest.tar.gz" SKIP_SHA_CHECK=true DIR_PATTERN="roc_nightly-${PLATFORM}-*"