File tree Expand file tree Collapse file tree 3 files changed +22
-18
lines changed
Expand file tree Collapse file tree 3 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 1+ # Taken from https://github.com/napi-rs/napi-rs/blob/main/.github/workflows/docker.yaml
2+ # and modified to build with latest rust and node 22
13name : Build Docker Images
24
35on :
68 branches :
79 - main
810 paths :
9- - ' docker/**'
11+ - " docker/**"
1012
1113permissions :
1214 contents : read
8587 uses : addnab/docker-run-action@v3
8688 with :
8789 image : node:lts-slim
88- options : ' --platform linux/arm64 --user 0:0 -v ${{ github.workspace }}/lib/llvm-18:/usr/lib/llvm-18'
90+ options : " --platform linux/arm64 --user 0:0 -v ${{ github.workspace }}/lib/llvm-18:/usr/lib/llvm-18"
8991 run : >-
9092 apt-get update &&
9193 apt-get install -y wget gnupg2 &&
@@ -112,4 +114,4 @@ jobs:
112114 push : true
113115 tags : ghcr.io/${{ github.repository }}/nodejs-rust:debian-aarch64
114116 cache-from : type=gha
115- cache-to : type=gha,mode=max
117+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 1111permissions :
1212 contents : write
1313 id-token : write
14+ packages : read
1415
1516on :
1617 workflow_dispatch : null
3940 docker : ghcr.io/${{ github.repository }}/nodejs-rust:debian
4041 build : |-
4142 set -e
42- rustup update stable
4343 yarn set version 3
4444 yarn build --target x86_64-unknown-linux-gnu
4545 strip *.node
4848 docker : ghcr.io/${{ github.repository }}/nodejs-rust:alpine
4949 build : |-
5050 set -e
51- rustup update stable
5251 yarn set version 3
5352 yarn build --target x86_64-unknown-linux-musl
5453 strip *.node
6463 docker : ghcr.io/${{ github.repository }}/nodejs-rust:debian-aarch64
6564 build : |-
6665 set -e
67- rustup update stable
6866 yarn set version 3
6967 yarn build --target aarch64-unknown-linux-gnu
7068 aarch64-unknown-linux-gnu-strip *.node
@@ -123,6 +121,16 @@ jobs:
123121 check-latest : true
124122 cache : yarn
125123 architecture : x86
124+ - name : Log in to GitHub Container Registry
125+ if : ${{ matrix.settings.docker }}
126+ uses : docker/login-action@v3
127+ with :
128+ registry : ghcr.io
129+ username : ${{ github.actor }}
130+ password : ${{ secrets.GITHUB_TOKEN }}
131+ - name : Pull Docker image
132+ if : ${{ matrix.settings.docker }}
133+ run : docker pull ${{ matrix.settings.docker }}
126134 - name : Build in docker
127135 uses : addnab/docker-run-action@v3
128136 if : ${{ matrix.settings.docker }}
Original file line number Diff line number Diff line change @@ -6,23 +6,17 @@ ENV PATH="/aarch64-linux-musl-cross/bin:/usr/local/cargo/bin/rustup:/root/.cargo
66 CXX="clang++" \
77 GN_EXE=gn
88
9- RUN apk add --update --no-cache bash wget cmake musl-dev clang llvm build-base python3 && \
10- sed -i -e 's/v[[:digit:]]\. .*\/ /edge\/ /g' /etc/apk/repositories && \
11- apk add --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing \
12- rustup \
13- git \
14- gn \
15- tar \
16- ninja && \
17- apk update && \
18- apk upgrade
9+ RUN apk add --update --no-cache bash wget cmake musl-dev clang llvm build-base python3 git tar ninja && \
10+ wget https://sh.rustup.rs -O rustup-init.sh && \
11+ chmod +x rustup-init.sh
1912
20- RUN rustup-init -y && \
13+ RUN ./ rustup-init.sh -y && \
2114 rustup update stable && \
2215 rustup default stable && \
2316 yarn global add pnpm lerna && \
2417 rustup target add aarch64-unknown-linux-musl && \
2518 rustup target add x86_64-unknown-linux-musl && \
2619 wget https://github.com/napi-rs/napi-rs/releases/download/linux-musl-cross%4010/aarch64-linux-musl-cross.tgz && \
2720 tar -xvf aarch64-linux-musl-cross.tgz && \
28- rm aarch64-linux-musl-cross.tgz
21+ rm aarch64-linux-musl-cross.tgz && \
22+ rm rustup-init.sh
You can’t perform that action at this time.
0 commit comments