forked from bnb-chain/greenfield-cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
810db48
commit 2cfe24d
Showing
7 changed files
with
226 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
declare change_log_file="./CHANGELOG.md" | ||
declare version="## $@" | ||
declare version_prefix="## v" | ||
declare start=0 | ||
declare CHANGE_LOG="" | ||
|
||
while read line; do | ||
if [[ $line == *"$version"* ]]; then | ||
start=1 | ||
continue | ||
fi | ||
if [[ $line == *"$version_prefix"* ]] && [ $start == 1 ]; then | ||
break; | ||
fi | ||
if [ $start == 1 ]; then | ||
CHANGE_LOG+="$line\n" | ||
fi | ||
done < "${change_log_file}" | ||
|
||
OUTPUT=$(cat <<-END | ||
${CHANGE_LOG}\n | ||
END | ||
) | ||
|
||
echo -e "${OUTPUT}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,49 @@ permissions: | |
jobs: | ||
main: | ||
permissions: | ||
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs | ||
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR | ||
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs | ||
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/[email protected] | ||
- uses: amannn/[email protected] | ||
id: lint_pr_title | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
types: | | ||
feat | ||
fix | ||
docs | ||
style | ||
refactor | ||
perf | ||
test | ||
build | ||
ci | ||
chore | ||
revert | ||
release | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
# When the previous steps fails, the workflow would stop. By adding this | ||
# condition you can continue the execution with the populated error message. | ||
if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
with: | ||
header: pr-title-lint-error | ||
message: | | ||
Hey there and thank you for opening this pull request! 👋🏼 | ||
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. | ||
Details: | ||
``` | ||
${{ steps.lint_pr_title.outputs.error_message }} | ||
``` | ||
# Delete a previous comment when the issue has been resolved | ||
- if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: pr-title-lint-error | ||
delete: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,44 +7,32 @@ on: | |
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write # for goreleaser/goreleaser-action to create a GitHub release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.8 | ||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- name: Create release | ||
uses: goreleaser/goreleaser-action@v3 | ||
with: | ||
args: release --rm-dist --release-notes ./RELEASE_NOTES.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set Env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
release-success: | ||
needs: release | ||
if: ${{ success() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify Slack on success | ||
uses: rtCamp/[email protected] | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate Change Log | ||
id: changelog | ||
run: | | ||
chmod 755 ./.github/generate_change_log.sh | ||
CHANGELOG=$(./.github/generate_change_log.sh ${{ env.RELEASE_VERSION }}) | ||
echo "CHANGELOG<<EOF" >> $GITHUB_ENV | ||
echo "$CHANGELOG" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_CHANNEL: cosmos-tech | ||
SLACK_USERNAME: Cosmos SDK Release Bot | ||
SLACK_ICON: https://avatars.githubusercontent.com/t/5997665?size=64 | ||
SLACK_COLOR: good | ||
SLACK_TITLE: "Cosmos SDK ${{ github.ref_name }} is tagged :tada:" | ||
SLACK_MESSAGE: "@channel :point_right: https://github.com/cosmos/cosmos-sdk/releases/tag/${{ github.ref_name }}" | ||
SLACK_FOOTER: "" | ||
SLACK_LINK_NAMES: true | ||
MSG_MINIMAL: true | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ env.RELEASE_VERSION}} | ||
release_name: ${{ env.RELEASE_VERSION}} | ||
body: | | ||
${{ env.CHANGELOG }} | ||
draft: false | ||
prerelease: false |
Oops, something went wrong.