[a] publish workflow test
Some checks failed
build / build (21) (push) Successful in 1m22s
Release Artifacts / upload-artifacts (release) Failing after 2s

This commit is contained in:
Sangelo 2024-06-09 20:05:36 +02:00
parent 5ffb944a29
commit cb6a129b40

View file

@ -0,0 +1,53 @@
name: Release Artifacts
on:
release:
types: [published]
jobs:
upload-artifacts:
runs-on: ubuntu-latest
steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
- name: Get the latest successful build
id: build
uses: https://github.com/actions/github-script@v6
with:
script: |
const { owner, repo } = context.repo;
const workflowRuns = await github.actions.listWorkflowRunsForRepo({
owner,
repo,
status: 'success',
event: 'push',
});
const latestRun = workflowRuns.data.workflow_runs[0];
return latestRun;
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
run-id: ${{ steps.build.outputs.id }}
- name: Create a directory for artifacts
run: mkdir -p release_artifacts
- name: Extract artifacts
run: |
for artifact in $(ls *.tar.gz); do
tar -xzf $artifact -C release_artifacts
done
shell: bash
- name: Upload artifacts to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: release_artifacts/*
asset_name: artifact.tar.gz
asset_content_type: application/gzip
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}