Skip to content

Commit

Permalink
Update create-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
helayoty authored Sep 12, 2023
1 parent 39cd017 commit 2148155
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ permissions:
contents: write
packages: write


env:
GO_VERSION: '1.20'

Expand All @@ -31,9 +30,35 @@ jobs:
with:
fetch-depth: 0
submodules: true
- uses: ./.github/actions/download-artifact
- name: Download tag artifact
uses: actions/github-script@v6
with:
github-token: ${{ secrets.KDM_ACCESS_TOKEN_READ }}
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 == "artifacts"
})[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(`/tmp/artifacts.zip`, Buffer.from(download.data));
- run: |
mkdir -p /tmp/artifacts
unzip /tmp/artifacts.zip -d /tmp/artifacts
shell: bash
- run: |
echo "Downloaded artifacts:"
ls -ablh /tmp/artifacts
shell: bash
- name: Parse artifacts and assign GA environment variables
run: |
tag=$(tail -n 1 /tmp/artifacts/tag.txt)
Expand Down

0 comments on commit 2148155

Please sign in to comment.