fix: artifact upload/extract (#88)
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -157,8 +157,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p output
|
mkdir -p output
|
||||||
podman save -o output/image.tar ${{ steps.build_image.outputs.image }}
|
podman save -o output/image.tar ${{ steps.build_image.outputs.image }}
|
||||||
echo "image=${{ steps.build_image.outputs.image }}" >> output/meta
|
echo "${{ steps.build_image.outputs.image }}" >> output/image
|
||||||
echo "tags=${{ steps.build_image.outputs.tags }}" >> output/meta
|
echo "${{ steps.build_image.outputs.tags }}" >> output/tags
|
||||||
|
|
||||||
- name: Publish Artifact
|
- name: Publish Artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|||||||
28
.github/workflows/pr-publish.yml
vendored
28
.github/workflows/pr-publish.yml
vendored
@@ -17,33 +17,19 @@ jobs:
|
|||||||
github.event.workflow_run.event == 'pull_request' &&
|
github.event.workflow_run.event == 'pull_request' &&
|
||||||
github.event.workflow_run.conclusion == 'success'
|
github.event.workflow_run.conclusion == 'success'
|
||||||
steps:
|
steps:
|
||||||
- name: 'Download artifact'
|
- uses: actions/download-artifact@v3
|
||||||
uses: actions/github-script@v3.1.0
|
|
||||||
with:
|
with:
|
||||||
script: |
|
name: output
|
||||||
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: Load Container Image
|
- name: Load Container Image
|
||||||
id: load_image
|
id: load_image
|
||||||
run: |
|
run: |
|
||||||
|
ls -lah
|
||||||
|
cat image
|
||||||
|
cat tags
|
||||||
podman load -i image.tar
|
podman load -i image.tar
|
||||||
cat meta >> $GITHUB_OUTPUT
|
echo image="$(cat image)" >> $GITHUB_OUTPUT
|
||||||
|
echo tags="$(cat tags)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Lowercase Registry
|
- name: Lowercase Registry
|
||||||
id: registry_case
|
id: registry_case
|
||||||
|
|||||||
Reference in New Issue
Block a user