Skip to content

Commit 31e7834

Browse files
committed
Add job to create a GitHub release
1 parent 2ce9569 commit 31e7834

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/release-prod.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,28 @@ jobs:
124124
curl -X POST -H "Content-Type:application/json" \
125125
-d "{\"version\":\"$BASE_VERSION\",\"date\":\"$DATE\"}" \
126126
$RELEASE_TRACKER_URL/logProduction
127+
- name: Create Github release
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
run: |
131+
# Get the newest release tag for the firebase package (e.g. [email protected])
132+
NEWEST_TAG=$(git describe --tags --match "firebase@[0-9]*.[0-9]*.[0-9]*" --abbrev=0)
133+
134+
# Get the release notes from the description of the most recent merged PR into the "release" branch
135+
# See: https://github.com/firebase/firebase-js-sdk/pull/8236
136+
RELEASE_NOTES=$(gh pr list \
137+
--repo "$GITHUB_REPOSITORY" \
138+
--state "merged" \
139+
--base "release" \
140+
--limit 1 \
141+
--json "body" \
142+
| jq '.[].body'\
143+
| jq -r . \
144+
| sed '1,/^# Releases/d')
145+
146+
# Create the GitHub release
147+
gh release create "$NEWEST_TAG" \
148+
--repo="$GITHUB_REPOSITORY" \
149+
--title="$NEWEST_TAG" \
150+
--notes "$RELEASE_NOTES" \
151+
--verify-tag

0 commit comments

Comments
 (0)