Skip to content

Feat: auto release (#9) #4

Feat: auto release (#9)

Feat: auto release (#9) #4

name: Release Artifacts Upload
on:
push:
branches:
- main
jobs:
upload-release-artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check for Release Creation
id: check-release
run: |
label="release"
pr_number=$(echo ${{ github.event.head_commit.message }} | grep -oE 'pull/[0-9]+' | cut -d'/' -f2)
if gh pr view $pr_number --json labels -q ".[].name" | grep -q "$label"; then
# Release label applied, check for release creation
release_url=$(gh pr view $pr_number --json links.html -q ".[] | select(.rel == \"html\") | .href")
release_id=$(basename $release_url)
echo "::set-output name=release_id::$release_id"
fi
shell: bash
- name: Upload Release Artifacts
if: steps.check-release.outputs.release_id != ''
run: |
gh release upload ${{ steps.check-release.outputs.release_id }} ./artifact/RTWRand-macos.zip
gh release upload ${{ steps.check-release.outputs.release_id }} ./artifact/RTWRand-windows.zip
gh release upload ${{ steps.check-release.outputs.release_id }} ./artifact/RTWRand-linux.zip