Process and Publish Artifacts #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Process and Publish Artifacts | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: 'Release tag to process artifacts from' | |
required: true | |
type: string | |
jobs: | |
process-artifacts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up environment | |
run: | | |
echo "RELEASE_TAG=${{ github.event.inputs.release_tag }}" >> $GITHUB_ENV | |
- name: Download and process artifacts | |
run: | | |
./process_artifacts.sh "${{ env.RELEASE_TAG }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: processed-${{ env.RELEASE_TAG }} | |
release_name: Processed Artifacts for ${{ env.RELEASE_TAG }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Assets | |
run: | | |
for file in artifacts/*.node; do | |
filename=$(basename "$file") | |
echo "Uploading $filename" | |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Content-Type: application/octet-stream" \ | |
--data-binary @"$file" \ | |
"${{ steps.create_release.outputs.upload_url }}?name=$filename" | |
done | |
- name: Clean up | |
run: rm -rf artifacts |