Skip to content

Commit

Permalink
Merge pull request #5673 from roc-lang/arm64-old-nightly
Browse files Browse the repository at this point in the history
added workflow to produce old linux arm64 nightly
  • Loading branch information
Anton-4 committed Jul 19, 2023
2 parents 6225b80 + 1bdfd80 commit d93fff0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/nightly_old_linux_arm64.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d93fff0

Please sign in to comment.