Skip to content

Commit

Permalink
bugfix: extract each packages-* instead of packages-cache-*
Browse files Browse the repository at this point in the history
  • Loading branch information
trombik committed Oct 17, 2024
1 parent 7b8abec commit 1cf2689
Showing 1 changed file with 9 additions and 36 deletions.
45 changes: 9 additions & 36 deletions .github/workflows/poudriere.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ jobs:
path: packages
if_no_artifact_found: warn

- name: tree packages
- name: Merge packages
run: |
if [ -d packages ]; then
tree packages
for D in `echo packages/*`; do
mv "${D}"/*.pkg packages/
rm -rf "${D}"
done
fi
tree packages
- name: Download ccache
uses: dawidd6/action-download-artifact@v6
Expand Down Expand Up @@ -181,8 +185,8 @@ jobs:
# pre-fill packages cache
if [ -d packages ]; then
ls -al packages
cp -R packages/* "/usr/local/poudriere/data/packages/${JAIL_NAME}-${PORTS_NAME}/All/"
rm -rf packages
sudo cp -R packages/* "/usr/local/poudriere/data/packages/${JAIL_NAME}-${PORTS_NAME}/All/"
sudo rm -rf packages
fi
# pre-fill ccache cache
Expand Down Expand Up @@ -268,41 +272,10 @@ jobs:
echo "::warning ::building ${{ matrix.PORT }} failed to build. the logs are available at: https://github.com/${{ github.repository }}/actions/runs/${{ github.github.run_id }}/artifacts/${{ steps.packages-upload-step.outputs.artifact-id }}"
fi
store-packages:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download built packages and merge them
uses: actions/download-artifact@v4
with:
pattern: packages-*
merge-multiple: true
path: packages

- name: List package cache
shell: sh
run: |
tree packages
- name: Create unique SHA-256 of inputs
id: sha256
shell: sh
run: |
PORTS_TO_BUILD_SHA256=`echo -n ${{ github.inputs.ports-to-build }} | sha256sum | cut -f 1 -d ' '`
echo "PORTS_TO_BUILD_SHA256=${PORTS_TO_BUILD_SHA256}" >> "${GITHUB_OUTPUT}"
cat "${GITHUB_OUTPUT}"
- name: Upload packages cache for future builds
uses: actions/upload-artifact@v4
with:
name: packages-cache-${{ steps.sha256.outputs.PORTS_TO_BUILD_SHA256 }}
path: packages

conclude-result:
runs-on: ubuntu-latest
needs:
- store-packages
- build
steps:
- name: Download logs
uses: actions/download-artifact@v4
Expand Down

0 comments on commit 1cf2689

Please sign in to comment.