Skip to content

release-hello-world-component #9

release-hello-world-component

release-hello-world-component #9

name: "release-hello-world-component"
on:
workflow_run:
workflows: [Build-And-Test-Component]
types:
- completed
branches:
- main
- enable-trigger
jobs:
on-success:
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
packages: write
repository-projects: write
security-events: write
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Download artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "hello-world-windows"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/hello-world-windows.zip`, Buffer.from(download.data));
- name: Display Root
run: |
dir
- name: 'Unzip artifact'
run: unzip hello-world-windows.zip
- name: Display Root
run: |
dir