FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
utPLSQL/.github/scripts/publish_release_post.sh at develop · utPLSQL/utPLSQL · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
utPLSQL
/
utPLSQL
Public
Notifications
You must be signed in to change notification settings
Fork
189
Star
622
Code
Issues
12
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
utPLSQL
/
.github
/
scripts
/
publish_release_post.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
61 lines (51 loc) · 2.25 KB
Breadcrumbs
utPLSQL
/
.github
/
scripts
/
publish_release_post.sh
Copy path
File metadata and controls
executable file
·
61 lines (51 loc) · 2.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!
/bin/bash
#
Publishes a release announcement post to utplsql.github.io.
#
Creates the post file, prepends an entry to docs/index.md,
#
and inserts the post into the mkdocs.yml nav.
#
#
Required environment variables:
#
API_TOKEN_GITHUB - GitHub token with write access to utPLSQL.github.io
#
RELEASE_TAG - e.g. v3.2.01
#
RELEASE_BODY - markdown release notes (from github.event.release.body)
#
RELEASE_DATE - ISO-8601 publish timestamp (from github.event.release.published_at)
set
-euo pipefail
GITHUB_IO_REPO=
"
utPLSQL/utPLSQL.github.io
"
GITHUB_IO_BRANCH=
"
main
"
VERSION=
"
${RELEASE_TAG
#
v}
"
POST_DATE=
$(
echo
"
${RELEASE_DATE}
"
|
cut -c1-10
)
POST_FILENAME=
"
${POST_DATE}
-version
${VERSION}
-released.md
"
POST_TITLE=
"
utPLSQL
${RELEASE_TAG}
released
"
POST_NAV_TITLE=
"
utPLSQL
${VERSION}
released
"
POST_PATH=
'
docs/announcements/posts
'
mkdir -p github_io
cd
github_io
git clone --depth 1
"
https://
${API_TOKEN_GITHUB}
@github.com/
${GITHUB_IO_REPO}
"
-b
"
${GITHUB_IO_BRANCH}
"
.
#
Format the release body for the post:
#
1. Convert bare GitHub issue/PR URLs to [#NUMBER](URL)
#
e.g. https://github.com/utPLSQL/utPLSQL/pull/1320
#
-> [#1320](https://github.com/utPLSQL/utPLSQL/pull/1320)
#
2. Convert the auto-generated "Full Changelog" bare URL to a labelled link
#
e.g. **Full Changelog**: https://.../compare/v3.2.01...v3.2.2
#
-> **Full Changelog**: [v3.2.01...v3.2.2](https://.../compare/v3.2.01...v3.2.2)
FORMATTED_BODY=
$(
echo
"
${RELEASE_BODY}
"
\
|
sed -E
'
s@https://github\.com/([^/]+)/([^/]+)/(pull|issues)/([0-9]+)@[#\4](https://github.com/\1/\2/\3/\4)@g
'
\
|
sed -E
'
s@\*\*Full Changelog\*\*: (https://[^ ]+/compare/([^ ]+))@\*\*Full Changelog\*\*: [\2](\1)@g
'
)
#
Create the post file
cat
>
"
${POST_PATH}
/
${POST_FILENAME}
"
<<
POSTEOF
---
layout: post
title: "
${POST_TITLE}
"
date:
created:
${POST_DATE}
categories:
- "releases"
- "utplsql-core"
---
${FORMATTED_BODY}
----------------------------
[Download utPLSQL release
${RELEASE_TAG}
here](https://github.com/utPLSQL/utPLSQL/releases/tag/
${RELEASE_TAG}
)
POSTEOF
git add
"
${POST_PATH}
/
${POST_FILENAME}
"
docs/index.md mkdocs.yml
git commit -m
"
Release announcement for
${RELEASE_TAG}
"
git push origin
"
${GITHUB_IO_BRANCH}
"
echo
"
Release post published:
${POST_PATH}
/
${POST_FILENAME}
"
Back
|
FazBrowse Home
|
New Git URL