3434 RELEASE_TAG : ${{ github.event.release.tag_name }}
3535 RELEASE_DATE : ${{ github.event.release.published_at }}
3636 TARGET_BRANCH : ${{ github.event.release.target_commitish }}
37- run : |
38- python3 - <<'PYEOF'
39- import os
40-
41- tag = os.environ['RELEASE_TAG']
42- body = os.environ['RELEASE_BODY'].strip()
43- date = os.environ['RELEASE_DATE'][:10]
44-
45- new_section = f"## [{tag}] - {date}\n\n{body}\n\n---\n\n"
46-
47- with open('CHANGELOG.md', 'r') as f:
48- content = f.read()
49-
50- marker = '\n---\n'
51- pos = content.index(marker) + len(marker)
52- updated = content[:pos] + '\n' + new_section + content[pos:]
53-
54- with open('CHANGELOG.md', 'w') as f:
55- f.write(updated)
56-
57- print(f"Added {tag} to CHANGELOG.md")
58- PYEOF
59- git add CHANGELOG.md
60- git commit -m "Add release notes for ${RELEASE_TAG} to CHANGELOG.md [skip ci]"
61- git push origin HEAD:"${TARGET_BRANCH}"
37+ run : .github/scripts/update_changelog.sh
6238
6339 - name : Set build version number env variables
6440 run : .github/scripts/set_release_version_numbers_env.sh
@@ -83,60 +59,23 @@ jobs:
8359 run : |
8460 git archive --prefix=utPLSQL/ -o utPLSQL.zip --format=zip HEAD
8561 git archive --prefix=utPLSQL/ -o utPLSQL.tar.gz --format=tar.gz HEAD
86- md5sum utPLSQL.zip --tag > utPLSQL.zip.md5
87- md5sum utPLSQL.tar.gz --tag > utPLSQL.tar.gz.md5
62+ sha256sum utPLSQL.zip --tag > utPLSQL.zip.sha256
63+ sha256sum utPLSQL.tar.gz --tag > utPLSQL.tar.gz.sha256
8864
8965 - name : Release
9066 uses : softprops/action-gh-release@v1
9167 with :
9268 files : |
9369 utPLSQL.zip
94- utPLSQL.zip.md5
70+ utPLSQL.zip.sha256
9571 utPLSQL.tar.gz
96- utPLSQL.tar.gz.md5
72+ utPLSQL.tar.gz.sha256
9773
9874 - name : Post release announcement to org discussions
9975 env :
10076 GH_TOKEN : ${{ secrets.ORG_DISCUSSION_TOKEN }}
10177 RELEASE_TAG : ${{ github.event.release.tag_name }}
10278 RELEASE_BODY : ${{ github.event.release.body }}
10379 RELEASE_URL : ${{ github.event.release.html_url }}
104- run : |
105- ORG="utPLSQL"
106-
107- ORG_DATA=$(gh api graphql -f query='query($org: String!) {
108- organization(login: $org) {
109- id
110- discussionCategories(first: 20) {
111- nodes { id name }
112- }
113- }
114- }' -f org="$ORG")
115-
116- ORG_ID=$(echo "$ORG_DATA" | jq -r '.data.organization.id')
117- CATEGORY_ID=$(echo "$ORG_DATA" | jq -r \
118- '.data.organization.discussionCategories.nodes[] | select(.name == "Announcements") | .id')
119-
120- BODY="${RELEASE_BODY}
121-
122- ---
123- [View full release on GitHub](${RELEASE_URL})"
124-
125- DISCUSSION_URL=$(gh api graphql -f query='mutation($orgId: ID!, $categoryId: ID!, $title: String!, $body: String!) {
126- createDiscussion(input: {
127- organizationId: $orgId,
128- categoryId: $categoryId,
129- title: $title,
130- body: $body
131- }) {
132- discussion { url }
133- }
134- }' \
135- -f orgId="$ORG_ID" \
136- -f categoryId="$CATEGORY_ID" \
137- -f title="utPLSQL ${RELEASE_TAG} released" \
138- -f body="$BODY" \
139- --jq '.data.createDiscussion.discussion.url')
140-
141- echo "Announcement posted: $DISCUSSION_URL"
80+ run : .github/scripts/post_release_announcement.sh
14281
0 commit comments