Skip to content

Commit

Permalink
fix: use docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 1, 2024
1 parent d83a700 commit 568d920
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,32 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build
id: build
uses: docker/build-push-action@v5
with:
build-args: |
PKG_FETCH_OPTION_n=node${{ matrix.target-node }}
context: .
file: ./Dockerfile.linux
platforms: linux/amd64
outputs: type=local,dest=./out
outputs: type=docker

- name: Extract binaries from Docker image
run: |
mkdir -p root/pkg-fetch/dist
ls -l ./out
mv ./out/* root/pkg-fetch/dist
mkdir -p dist
CONTAINER_ID=$(docker create ${{ steps.build.outputs.imageid }})
docker cp $CONTAINER_ID:/root/pkg-fetch/dist ./dist
- name: Check if binary is compiled
id: check_file
run: |
(test -f root/pkg-fetch/dist/*.sha256sum && echo "EXISTS=true" >> $GITHUB_OUTPUT) || echo "EXISTS=false" >> $GITHUB_OUTPUT
(test -f ./dist/*.sha256sum && echo "EXISTS=true" >> $GITHUB_OUTPUT) || echo "EXISTS=false" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-linux-x64
path: root/pkg-fetch/dist/*
path: ./dist/*

linux-arm64:
runs-on: ubuntu-20.04
Expand All @@ -61,6 +62,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build
id: build
uses: docker/build-push-action@v5
with:
build-args: |
Expand All @@ -70,21 +72,21 @@ jobs:
context: .
file: ./Dockerfile.linuxcross
platforms: linux/amd64
outputs: type=local,dest=./out
outputs: type=docker

- name: Extract binaries from Docker image
run: |
mkdir -p root/pkg-fetch/dist
ls -l ./out
mv ./out/* root/pkg-fetch/dist
mkdir -p dist
CONTAINER_ID=$(docker create ${{ steps.build.outputs.imageid }})
docker cp $CONTAINER_ID:/root/pkg-fetch/dist ./dist
- name: Check if binary is compiled
id: check_file
run: |
(test -f root/pkg-fetch/dist/*.sha256sum && echo "EXISTS=true" >> $GITHUB_OUTPUT) || echo "EXISTS=false" >> $GITHUB_OUTPUT
(test -f ./dist/*.sha256sum && echo "EXISTS=true" >> $GITHUB_OUTPUT) || echo "EXISTS=false" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-linux-arm64
path: root/pkg-fetch/dist/*
path: ./dist/*

0 comments on commit 568d920

Please sign in to comment.