Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build-docker-images.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Taken from https://github.com/napi-rs/napi-rs/blob/main/.github/workflows/docker.yaml
# and modified to build with latest rust and node 22
name: Build Docker Images

on:
Expand All @@ -6,7 +8,7 @@ on:
branches:
- main
paths:
- 'docker/**'
- "docker/**"

permissions:
contents: read
Expand Down Expand Up @@ -85,7 +87,7 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: node:lts-slim
options: '--platform linux/arm64 --user 0:0 -v ${{ github.workspace }}/lib/llvm-18:/usr/lib/llvm-18'
options: "--platform linux/arm64 --user 0:0 -v ${{ github.workspace }}/lib/llvm-18:/usr/lib/llvm-18"
run: >-
apt-get update &&
apt-get install -y wget gnupg2 &&
Expand All @@ -112,4 +114,4 @@ jobs:
push: true
tags: ghcr.io/${{ github.repository }}/nodejs-rust:debian-aarch64
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
14 changes: 11 additions & 3 deletions .github/workflows/publish_to_npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
permissions:
contents: write
id-token: write
packages: read

on:
workflow_dispatch: null
Expand Down Expand Up @@ -39,7 +40,6 @@ jobs:
docker: ghcr.io/${{ github.repository }}/nodejs-rust:debian
build: |-
set -e
rustup update stable
yarn set version 3
yarn build --target x86_64-unknown-linux-gnu
strip *.node
Expand All @@ -48,7 +48,6 @@ jobs:
docker: ghcr.io/${{ github.repository }}/nodejs-rust:alpine
build: |-
set -e
rustup update stable
yarn set version 3
yarn build --target x86_64-unknown-linux-musl
strip *.node
Expand All @@ -64,7 +63,6 @@ jobs:
docker: ghcr.io/${{ github.repository }}/nodejs-rust:debian-aarch64
build: |-
set -e
rustup update stable
yarn set version 3
yarn build --target aarch64-unknown-linux-gnu
aarch64-unknown-linux-gnu-strip *.node
Expand Down Expand Up @@ -123,6 +121,16 @@ jobs:
check-latest: true
cache: yarn
architecture: x86
- name: Log in to GitHub Container Registry
if: ${{ matrix.settings.docker }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Docker image
if: ${{ matrix.settings.docker }}
run: docker pull ${{ matrix.settings.docker }}
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
Expand Down
18 changes: 6 additions & 12 deletions docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,17 @@ ENV PATH="/aarch64-linux-musl-cross/bin:/usr/local/cargo/bin/rustup:/root/.cargo
CXX="clang++" \
GN_EXE=gn

RUN apk add --update --no-cache bash wget cmake musl-dev clang llvm build-base python3 && \
sed -i -e 's/v[[:digit:]]\..*\//edge\//g' /etc/apk/repositories && \
apk add --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing \
rustup \
git \
gn \
tar \
ninja && \
apk update && \
apk upgrade
RUN apk add --update --no-cache bash wget cmake musl-dev clang llvm build-base python3 git tar ninja && \
wget https://sh.rustup.rs -O rustup-init.sh && \
chmod +x rustup-init.sh

RUN rustup-init -y && \
RUN ./rustup-init.sh -y && \
rustup update stable && \
rustup default stable && \
yarn global add pnpm lerna && \
rustup target add aarch64-unknown-linux-musl && \
rustup target add x86_64-unknown-linux-musl && \
wget https://github.com/napi-rs/napi-rs/releases/download/linux-musl-cross%4010/aarch64-linux-musl-cross.tgz && \
tar -xvf aarch64-linux-musl-cross.tgz && \
rm aarch64-linux-musl-cross.tgz
rm aarch64-linux-musl-cross.tgz && \
rm rustup-init.sh