diff --git a/.docker/build-linux.sh b/.docker/build-linux.sh index fa5e7bb08..d37b57f19 100755 --- a/.docker/build-linux.sh +++ b/.docker/build-linux.sh @@ -44,17 +44,7 @@ cd "$HOME" rm -rf dwarfs dwarfs-* if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then - TARBALL="dwarfs-source-${GITHUB_RUN_NUMBER}.tar.zst" - TARBALL_PATH="" - if [ -f "/tmp-runner/artifacts/$TARBALL" ]; then - TARBALL_PATH="/tmp-runner/artifacts" - elif [ -f "/workspace/$TARBALL" ]; then - TARBALL_PATH="/workspace" - else - echo "source tarball not found: $TARBALL" - exit 1 - fi - tar xf "$TARBALL_PATH/$TARBALL" + tar xf "/artifacts/cache/dwarfs-source-${GITHUB_RUN_NUMBER}.tar.zst" ln -s dwarfs-* dwarfs else git config --global --add safe.directory /workspace @@ -314,9 +304,8 @@ else elif [[ "-$BUILD_TYPE-" == *-source-* ]]; then $BUILD_TOOL package_source $BUILD_TOOL copy_source_artifacts - rm -rf /tmp-runner/artifacts - mkdir -p /tmp-runner/artifacts - cp dwarfs-*.tar.zst /tmp-runner/artifacts/dwarfs-source-${GITHUB_RUN_NUMBER}.tar.zst + mkdir -p /artifacts/cache + cp dwarfs-*.tar.zst /artifacts/cache/dwarfs-source-${GITHUB_RUN_NUMBER}.tar.zst fi if [[ "-$BUILD_TYPE-" != *-[at]san-* ]] && \ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d29f77eec..1ca9c1528 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -137,27 +137,6 @@ jobs: --env GITHUB_RUN_ATTEMPT \ dwarfs-linux-build-arch - - name: Upload Source Package - uses: actions/upload-artifact@v4 - with: - name: dwarfs-source - path: ${{ runner.temp }}/artifacts/dwarfs-source-${{ github.run_number }}.tar.zst - if-no-files-found: error - compression-level: 0 - - - name: Move Source Tarball For Caching - run: | - mv ${{ runner.temp }}/artifacts/dwarfs-source-${{ github.run_number }}.tar.zst ${GITHUB_WORKSPACE}/ - - - name: Cache Source Tarball - uses: actions/cache/save@v4 - with: - path: dwarfs-source-${{ github.run_number }}.tar.zst - key: dwarfs-source-run-${{ github.run_number }} - - - name: Remove Source Tarball - run: rm -v dwarfs-source-${{ github.run_number }}.tar.zst - linux-src: needs: package-source @@ -224,31 +203,6 @@ jobs: fetch-depth: '0' ref: ${{ github.ref }} - - name: Fetch Source Tarball From Cache - id: source-tarball - uses: actions/cache/restore@v4 - with: - path: dwarfs-source-${{ github.run_number }}.tar.zst - key: dwarfs-source-run-${{ github.run_number }} - - - name: Download Source Tarball Artifact - if: steps.source-tarball.outputs.cache-hit != 'true' - uses: actions/download-artifact@v4 - with: - name: dwarfs-source - - - name: Re-cache Source Tarball - if: steps.source-tarball.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: dwarfs-source-${{ github.run_number }}.tar.zst - key: dwarfs-source-run-${{ github.run_number }} - - - name: Move Tarball To Artifacts Location - run: | - mkdir -p ${{ runner.temp }}/artifacts - mv ${GITHUB_WORKSPACE}/dwarfs-source-${{ github.run_number }}.tar.zst ${{ runner.temp }}/artifacts/ - - name: Build Docker Image run: | docker build \ @@ -266,6 +220,7 @@ jobs: --mount type=bind,source=${{ runner.temp }},target=/tmp-runner \ --mount type=bind,source=/home/mhx/github-ccache,target=/ccache \ --mount type=bind,source=/home/mhx/github-local,target=/local \ + --mount type=bind,source=/mnt/opensource/artifacts/dwarfs,target=/artifacts \ --env BUILD_FROM_TARBALL=1 \ --env BUILD_TYPE=${{ matrix.build_type }} \ --env BUILD_ARCH=${{ matrix.arch }} \