This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
57 lines (48 loc) · 1.61 KB
/
build-alpine.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build Node binaries for Alpine
on:
workflow_dispatch:
workflow_call:
jobs:
alpine:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target-node: [14, 16, 18, 19]
target-arch: [x64, arm64]
include:
- target-arch: x64
target-triple: x86_64-linux-musl
host-arch: x86_64
- target-arch: arm64
target-triple: aarch64-linux-musl
host-arch: x86_64
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2
with:
build-args: |
HOST_ARCH=${{ matrix.host-arch }}
TARGET_TRIPLE=${{ matrix.target-triple }}
PKG_FETCH_OPTION_a=${{ matrix.target-arch }}
PKG_FETCH_OPTION_n=node${{ matrix.target-node }}
PKG_FETCH_OPTION_p=alpine
context: .
file: ./Dockerfile.alpine
platforms: linux/amd64
outputs: type=tar,dest=../out.tar
- name: Extract binaries from Docker image
run: |
tar xvf ../out.tar root/pkg-fetch/dist
- name: Check if binary is compiled
id: check_file
run: |
(test -f root/pkg-fetch/dist/*.sha256sum && echo ::set-output name=EXISTS::true) || echo ::set-output name=EXISTS::false
- uses: actions/upload-artifact@v2
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-alpine-${{ matrix.target-arch }}
path: root/pkg-fetch/dist/*