diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 6e338b18..4c394438 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -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 @@ -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/* diff --git a/Dockerfile.linux b/Dockerfile.linux index 0c2407fe..6fde1b6a 100644 --- a/Dockerfile.linux +++ b/Dockerfile.linux @@ -1,4 +1,4 @@ -FROM oraclelinux:7 +FROM oraclelinux:7 AS build USER root:root WORKDIR /root/pkg-fetch/ @@ -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 /