diff --git a/.github/workflows/basic_cli_build_release.yml b/.github/workflows/basic_cli_build_release.yml index 5bf8987683..85075ec304 100644 --- a/.github/workflows/basic_cli_build_release.yml +++ b/.github/workflows/basic_cli_build_release.yml @@ -12,8 +12,14 @@ jobs: steps: - uses: actions/checkout@v3 - - name: fetch releases data and save to file - run: curl https://api.github.com/repos/roc-lang/roc/releases > roc_releases.json + # note: moving this step to a bash script will not work, the GITHUB_TOKEN is not passed properly + - name: Fetch releases data and save to file. Authorization is used to prevent rate limiting due to shared IP of github's macos ci servers. + run: | + curl --request GET \ + --url https://api.github.com/repos/roc-lang/roc/releases \ + --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ + --header 'content-type: application/json' \ + --output roc_releases.json - run: cat roc_releases.json @@ -80,8 +86,14 @@ jobs: - name: remove all folders except the ci folder run: shopt -s extglob && rm -r ./!(ci)/ - - name: fetch releases data and save to file - run: curl https://api.github.com/repos/roc-lang/roc/releases > roc_releases.json + # note: moving this step to a bash script will not work, the GITHUB_TOKEN is not passed properly + - name: Fetch releases data and save to file. Authorization is used to prevent rate limiting due to shared IP of github's macos ci servers. + run: | + curl --request GET \ + --url https://api.github.com/repos/roc-lang/roc/releases \ + --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ + --header 'content-type: application/json' \ + --output roc_releases.json - run: echo "ROC_RELEASE_URL=$(./ci/get_latest_release_url.sh linux_x86_64)" >> $GITHUB_ENV diff --git a/ci/build_basic_cli.sh b/ci/build_basic_cli.sh index 9099e94e26..e9b61489a1 100755 --- a/ci/build_basic_cli.sh +++ b/ci/build_basic_cli.sh @@ -17,9 +17,12 @@ ls | grep "roc_nightly.*tar\.gz" | xargs tar -xzvf # build the basic cli platform ./roc build ../basic-cli/examples/file.roc +# We need this extra variable so we can safely check if $2 is empty later +EXTRA_ARGS=${2:-} + # In some rare cases it's nice to be able to use the legacy linker, so we produce the .o file to be able to do that -if [[ -n $2 ]]; then - ./roc build $2 ../basic-cli/examples/file.roc +if [ ! -z ${EXTRA_ARGS} ]; + then ./roc build $EXTRA_ARGS ../basic-cli/examples/file.roc fi cd ..