Skip to content

Commit 6652fc9

Browse files
authored
Create release for windows arm64 (#50)
* Add comment * simplify alpine docker file * Remove rustup update command in docker build * Add auth for ghcr * Correct auth of ghcr * Pull docker image before using * Add packages read permissions * Simplify workflow * Revert "Simplify workflow" This reverts commit 2a263e6.
1 parent 8ece1b3 commit 6652fc9

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

.github/workflows/build-docker-images.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
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
13
name: Build Docker Images
24

35
on:
@@ -6,7 +8,7 @@ on:
68
branches:
79
- main
810
paths:
9-
- 'docker/**'
11+
- "docker/**"
1012

1113
permissions:
1214
contents: read
@@ -85,7 +87,7 @@ jobs:
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

.github/workflows/publish_to_npm.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
permissions:
1212
contents: write
1313
id-token: write
14+
packages: read
1415

1516
on:
1617
workflow_dispatch: null
@@ -39,7 +40,6 @@ jobs:
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
@@ -48,7 +48,6 @@ jobs:
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
@@ -64,7 +63,6 @@ jobs:
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 }}

docker/alpine.Dockerfile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)