diff --git a/.github/workflows/nightly_old_linux_arm64.yml b/.github/workflows/nightly_old_linux_arm64.yml new file mode 100644 index 00000000000..adee12b47fd --- /dev/null +++ b/.github/workflows/nightly_old_linux_arm64.yml @@ -0,0 +1,38 @@ +on: + workflow_dispatch: + schedule: + - cron: '0 9 * * *' + +name: Nightly Release Old Linux arm64 using Earthly + +jobs: + build: + name: build and package nightly release + runs-on: [self-hosted, Linux, ARM64] + timeout-minutes: 90 + steps: + - uses: actions/checkout@v3 + + - name: get commit SHA + run: echo "SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV + + - name: get date + run: echo "DATE=$(date "+%Y-%m-%d")" >> $GITHUB_ENV + + - name: build file name + env: + DATE: ${{ env.DATE }} + SHA: ${{ env.SHA }} + run: echo "RELEASE_FOLDER_NAME=roc_nightly-old_linux_arm64-$DATE-$SHA" >> $GITHUB_ENV + + - run: earthly --version + + - name: build release with earthly + run: earthly +build-nightly-release --RELEASE_FOLDER_NAME=${{ env.RELEASE_FOLDER_NAME }} --ZIG_ARCH=aarch64 + + - name: Upload roc nightly tar. Actually uploading to github releases has to be done manually. + uses: actions/upload-artifact@v3 + with: + name: ${{ env.RELEASE_FOLDER_NAME }}.tar.gz + path: ${{ env.RELEASE_FOLDER_NAME }}.tar.gz + retention-days: 4 diff --git a/.github/workflows/nightly_linux_x86_64_earthly.yml b/.github/workflows/nightly_old_linux_x86_64.yml similarity index 95% rename from .github/workflows/nightly_linux_x86_64_earthly.yml rename to .github/workflows/nightly_old_linux_x86_64.yml index 2d055307e7f..03440f73e25 100644 --- a/.github/workflows/nightly_linux_x86_64_earthly.yml +++ b/.github/workflows/nightly_old_linux_x86_64.yml @@ -31,7 +31,7 @@ jobs: - run: earthly --version - name: build release with earthly - run: earthly +build-nightly-release --RELEASE_FOLDER_NAME=${{ env.RELEASE_FOLDER_NAME }} + run: earthly +build-nightly-release --RELEASE_FOLDER_NAME=${{ env.RELEASE_FOLDER_NAME }} --RUSTFLAGS="-C target-cpu=x86-64" - name: Upload roc nightly tar. Actually uploading to github releases has to be done manually. uses: actions/upload-artifact@v3 diff --git a/Earthfile b/Earthfile index e69c3364e7c..90aa1b5d702 100644 --- a/Earthfile +++ b/Earthfile @@ -13,11 +13,12 @@ install-other-libs: RUN apt -y install unzip # for www/build.sh install-zig-llvm: + ARG ZIG_ARCH FROM +install-other-libs # zig - RUN wget -c https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz --no-check-certificate - RUN tar -xf zig-linux-x86_64-0.9.1.tar.xz - RUN ln -s /earthbuild/zig-linux-x86_64-0.9.1/zig /bin/zig + RUN wget -c https://ziglang.org/download/0.9.1/zig-linux-$ZIG_ARCH-0.9.1.tar.xz --no-check-certificate + RUN tar -xf zig-linux-$ZIG_ARCH-0.9.1.tar.xz + RUN ln -s /earthbuild/zig-linux-$ZIG_ARCH-0.9.1/zig /bin/zig # zig builtins wasm tests RUN apt -y install build-essential # llvm @@ -39,16 +40,19 @@ install-zig-llvm: ENV CARGO_INCREMENTAL=0 # no need to recompile package when using new function copy-dirs: - FROM +install-zig-llvm + ARG ZIG_ARCH + FROM +install-zig-llvm --ZIG_ARCH=$ZIG_ARCH COPY --dir crates examples Cargo.toml Cargo.lock version.txt .cargo www rust-toolchain.toml ./ build-nightly-release: ARG RELEASE_FOLDER_NAME - FROM +copy-dirs + ARG RUSTFLAGS + ARG ZIG_ARCH=x86_64 + FROM +copy-dirs --ZIG_ARCH=$ZIG_ARCH COPY --dir .git LICENSE LEGAL_DETAILS ci ./ # version.txt is used by the CLI: roc --version RUN ./ci/write_version.sh - RUN RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc + RUN RUSTFLAGS=$RUSTFLAGS cargo build --profile=release-with-lto --locked --bin roc # strip debug info RUN strip ./target/release-with-lto/roc RUN ./ci/package_release.sh $RELEASE_FOLDER_NAME