-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add job to create a GitHub release #8248
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,3 +124,28 @@ jobs: | |
curl -X POST -H "Content-Type:application/json" \ | ||
-d "{\"version\":\"$BASE_VERSION\",\"date\":\"$DATE\"}" \ | ||
$RELEASE_TRACKER_URL/logProduction | ||
- name: Create Github release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Get the newest release tag for the firebase package (e.g. [email protected]) | ||
NEWEST_TAG=$(git describe --tags --match "firebase@[0-9]*.[0-9]*.[0-9]*" --abbrev=0) | ||
# Get the release notes from the description of the most recent merged PR into the "release" branch | ||
# See: https://github.com/firebase/firebase-js-sdk/pull/8236 for an example description | ||
RELEASE_NOTES=$(gh pr list \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Were we going to add in some text to say "For more detailed release notes, see Firebase JavaScript SDK Release Notes."? You might want to test if you have to escape any of those markdown linking characters. Changesets are better than commits but I think release notes may have more info than changesets. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Here's an example release with the new release notes: https://github.com/dlarocque/firebase-js-sdk/releases/tag/firebase%405.5.5 |
||
--repo "$GITHUB_REPOSITORY" \ | ||
--state "merged" \ | ||
--base "release" \ | ||
--limit 1 \ | ||
--json "body" \ | ||
| jq '.[].body'\ | ||
| jq -r . \ | ||
| sed '1,/^# Releases/d') | ||
# Create the GitHub release | ||
gh release create "$NEWEST_TAG" \ | ||
--repo="$GITHUB_REPOSITORY" \ | ||
--title="$NEWEST_TAG" \ | ||
--notes "$RELEASE_NOTES" \ | ||
--verify-tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of --match to solve this problem.