Skip to content

Commit

Permalink
fix: use local exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 2, 2024
1 parent 43f0578 commit 1116231
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@ jobs:
context: .
file: ./Dockerfile.linux
platforms: linux/amd64
outputs: type=docker

- name: Extract binaries from Docker image
run: |
mkdir -p dist
CONTAINER_ID=$(docker create ${{ steps.build.outputs.imageid }})
docker cp $CONTAINER_ID:/root/pkg-fetch/dist ./dist
outputs: type=local, dest=dist

- name: Check if binary is compiled
id: check_file
run: |
(test -f ./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: ./dist/*
path: dist/*

linux-arm64:
runs-on: ubuntu-20.04
Expand All @@ -72,21 +66,15 @@ jobs:
context: .
file: ./Dockerfile.linuxcross
platforms: linux/amd64
outputs: type=docker

- name: Extract binaries from Docker image
run: |
mkdir -p dist
CONTAINER_ID=$(docker create ${{ steps.build.outputs.imageid }})
docker cp $CONTAINER_ID:/root/pkg-fetch/dist ./dist
outputs: type=local, dest=dist

- name: Check if binary is compiled
id: check_file
run: |
(test -f ./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: ./dist/*
path: dist/*
5 changes: 4 additions & 1 deletion Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM oraclelinux:7
FROM oraclelinux:7 AS build

USER root:root
WORKDIR /root/pkg-fetch/
Expand Down Expand Up @@ -27,3 +27,6 @@ RUN scl enable devtoolset-10 rh-python36 \
" \
yarn start --node-range $PKG_FETCH_OPTION_n --output dist \
"

FROM scratch
COPY --from=build /root/pkg-fetch/dist /

0 comments on commit 1116231

Please sign in to comment.