| name: Shared - Release Grid | |
| on: | |
| workflow_call: | |
| inputs: | |
| artifact-name: | |
| description: Artifact holding the Grid packages to attach to the nightly release | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Release Grid | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download grid packages | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ inputs.artifact-name }} | |
| path: build/dist | |
| - name: Create nightly release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| TARGET: ${{ github.event.pull_request.merge_commit_sha || github.sha }} | |
| run: | | |
| set -euo pipefail | |
| if gh release view nightly >/dev/null 2>&1; then | |
| gh release delete nightly --yes | |
| fi | |
| if gh api "repos/$GH_REPO/git/ref/tags/nightly" >/dev/null 2>&1; then | |
| gh api -X DELETE "repos/$GH_REPO/git/refs/tags/nightly" | |
| fi | |
| gh release create nightly build/dist/*.* \ | |
| --target "$TARGET" \ | |
| --title Nightly \ | |
| --prerelease \ | |
| --generate-notes |