Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,34 @@ jobs:
run: |
content=`cat ./package.json | tr '\n' ' '`
echo "json=$content" >> $GITHUB_OUTPUT
- run: |
git tag v${{ fromJson(steps.pkg.outputs.json).version }}
git push https://x-access-token:${{ steps.octo-sts.outputs.token }}@github.com/${{ github.repository }}.git v${{ fromJson(steps.pkg.outputs.json).version }}
- name: Tag release
run: |
version="${{ fromJson(steps.pkg.outputs.json).version }}"
remote="https://x-access-token:${{ steps.octo-sts.outputs.token }}@github.com/${{ github.repository }}.git"
# Idempotent, so that a rerun after a partial failure can still
# repair the tag and the release notes.
if git ls-remote --tags "$remote" "v$version" | grep -q "v$version"; then
echo "Tag v$version already exists, skipping"
else
git tag "v$version"
git push "$remote" "v$version"
fi
- name: Release notes
env:
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
VERSION: ${{ fromJson(steps.pkg.outputs.json).version }}
run: |
# The release notes are the body of the proposal PR, looked up by its
# head branch. This resolves even after the branch is deleted on merge.
notes="$RUNNER_TEMP/v$VERSION.md"
gh pr view "v$VERSION-proposal" --json body --jq .body > "$notes"
# v5.x is currently the only release line. Once a second one ships,
# --latest has to be decided per branch rather than hardcoded.
if gh release view "v$VERSION" > /dev/null 2>&1; then
gh release edit "v$VERSION" --title "$VERSION" -F "$notes" --latest
else
gh release create "v$VERSION" --target "${{ github.ref_name }}" --title "$VERSION" -F "$notes" --latest
fi

publish_dev:
needs: build
Expand Down
Loading