diff --git a/.github/workflows/nightly_linux_arm64.yml b/.github/workflows/nightly_linux_arm64.yml index 96f9d5d9582..cecd98cba8b 100644 --- a/.github/workflows/nightly_linux_arm64.yml +++ b/.github/workflows/nightly_linux_arm64.yml @@ -25,7 +25,7 @@ jobs: run: ./ci/write_version.sh - name: build release with lto - run: cargo build --profile=release-with-lto --locked --bin roc + run: cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls - name: get commit SHA run: echo "SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV diff --git a/.github/workflows/nightly_linux_x86_64.yml b/.github/workflows/nightly_linux_x86_64.yml index d285e65136d..a08befd34f5 100644 --- a/.github/workflows/nightly_linux_x86_64.yml +++ b/.github/workflows/nightly_linux_x86_64.yml @@ -25,7 +25,7 @@ jobs: run: ./ci/write_version.sh - name: build release with lto - run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc + run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls # target-cpu=x86-64 -> For maximal compatibility for all CPU's. This was also faster in our tests: https://roc.zulipchat.com/#narrow/stream/231635-compiler-development/topic/.2Ecargo.2Fconfig.2Etoml/near/325726299 - name: get commit SHA diff --git a/.github/workflows/nightly_macos_apple_silicon.yml b/.github/workflows/nightly_macos_apple_silicon.yml index 63340de3039..840367c472d 100644 --- a/.github/workflows/nightly_macos_apple_silicon.yml +++ b/.github/workflows/nightly_macos_apple_silicon.yml @@ -42,11 +42,7 @@ jobs: run: ./ci/write_version.sh - name: build nightly release - run: cargo build --locked --profile=release-with-lto --bin roc - - # this makes the roc binary a lot smaller - - name: strip debug info - run: strip ./target/release-with-lto/roc + run: cargo build --locked --profile=release-with-lto --bin roc --bin roc_ls - name: package release run: ./ci/package_release.sh ${{ env.RELEASE_FOLDER_NAME }} diff --git a/.github/workflows/nightly_macos_x86_64.yml b/.github/workflows/nightly_macos_x86_64.yml index 6dd330aa991..7b26a15a8e0 100644 --- a/.github/workflows/nightly_macos_x86_64.yml +++ b/.github/workflows/nightly_macos_x86_64.yml @@ -32,7 +32,7 @@ jobs: # this issue may be caused by using older versions of XCode - name: build release - run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc + run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls # target-cpu=x86-64 -> For maximal compatibility for all CPU's. - name: get commit SHA diff --git a/Earthfile b/Earthfile index ae0df6e89c7..bb217ad5722 100644 --- a/Earthfile +++ b/Earthfile @@ -53,9 +53,7 @@ build-nightly-release: COPY --dir .git LICENSE LEGAL_DETAILS ci ./ # version.txt is used by the CLI: roc --version RUN ./ci/write_version.sh - RUN RUSTFLAGS=$RUSTFLAGS cargo build --profile=release-with-lto --locked --bin roc - # strip debug info - RUN strip ./target/release-with-lto/roc + RUN RUSTFLAGS=$RUSTFLAGS cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls RUN ./ci/package_release.sh $RELEASE_FOLDER_NAME RUN ls SAVE ARTIFACT ./$RELEASE_FOLDER_NAME.tar.gz AS LOCAL $RELEASE_FOLDER_NAME.tar.gz diff --git a/ci/package_release.sh b/ci/package_release.sh index e99680f3e50..131e155b61c 100755 --- a/ci/package_release.sh +++ b/ci/package_release.sh @@ -3,15 +3,21 @@ # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ set -euxo pipefail -cp target/release-with-lto/roc ./roc # to be able to delete "target" later +# this makes the binaries a lot smaller +strip ./target/release-with-lto/roc +strip ./target/release-with-lto/roc_ls + +# to be able to delete "target" later +cp target/release-with-lto/roc ./roc +cp target/release-with-lto/roc_ls ./roc_lang_server # delete unnecessary files and folders -git clean -fdx --exclude roc +git clean -fdx --exclude roc --exclude roc_lang_server mkdir $1 -mv roc LICENSE LEGAL_DETAILS $1 +mv roc roc_lang_server LICENSE LEGAL_DETAILS $1 mkdir $1/examples mv examples/helloWorld.roc examples/platform-switching examples/cli $1/examples