Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
fix: artifact upload/extract (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoceppi authored Feb 28, 2023
1 parent 1726d18 commit 6590066
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ jobs:
run: |
mkdir -p output
podman save -o output/image.tar ${{ steps.build_image.outputs.image }}
echo "image=${{ steps.build_image.outputs.image }}" >> output/meta
echo "tags=${{ steps.build_image.outputs.tags }}" >> output/meta
echo "${{ steps.build_image.outputs.image }}" >> output/image
echo "${{ steps.build_image.outputs.tags }}" >> output/tags
- name: Publish Artifact
uses: actions/upload-artifact@v2
Expand Down
28 changes: 7 additions & 21 deletions .github/workflows/pr-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,19 @@ jobs:
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
- uses: actions/download-artifact@v3
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "output"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/output.zip', Buffer.from(download.data));
- run: unzip output.zip
name: output

- name: Load Container Image
id: load_image
run: |
ls -lah
cat image
cat tags
podman load -i image.tar
cat meta >> $GITHUB_OUTPUT
echo image="$(cat image)" >> $GITHUB_OUTPUT
echo tags="$(cat tags)" >> $GITHUB_OUTPUT
- name: Lowercase Registry
id: registry_case
Expand Down

0 comments on commit 6590066

Please sign in to comment.