-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #707 from secretkeylabs/release/v0.26.0
release: v0.26.0 to main
- Loading branch information
Showing
48 changed files
with
1,396 additions
and
145 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,39 @@ | ||
name: Create release PR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
bump: | ||
description: 'Version bump level' | ||
required: true | ||
default: patch | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
create-release-pr: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
issues: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
- id: run-create-release-pr-sh | ||
env: | ||
BUMP: ${{ inputs.bump }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
# git config | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
# run shell script | ||
cd scripts | ||
./create-release-pr.sh |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,3 @@ | ||
release.json | ||
pr-*.json | ||
body.md |
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,74 @@ | ||
#! /bin/bash | ||
|
||
if [[ -z "$BUMP" ]]; then | ||
echo "BUMP is required. major|minor|patch" | ||
exit 1 | ||
fi | ||
|
||
echo -e "\n--- Prepare for $BUMP release branch ---" | ||
|
||
git fetch --all | ||
git checkout develop | ||
git pull | ||
|
||
npm version $BUMP --git-tag-version=false | ||
VERSION=$(npm pkg get version | sed 's/"//g') | ||
TAG="v$VERSION" | ||
BRANCH="release/$TAG" | ||
TITLE="release: $TAG" | ||
|
||
git checkout -B $BRANCH | ||
git commit -am "$TITLE" | ||
git merge origin/main -s ours | ||
|
||
git push --set-upstream origin $BRANCH | ||
|
||
echo -e "\n--- Create draft release for $TAG ---" | ||
|
||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/{owner}/{repo}/releases \ | ||
-f tag_name=$TAG \ | ||
-f target_commitish="$BRANCH" \ | ||
-f name=$TAG \ | ||
-F draft=true \ | ||
-F prerelease=true \ | ||
-F generate_release_notes=true > release.json | ||
|
||
cat release.json | jq -r .body > body.md | ||
echo -e "\n\nDraft release: $(cat release.json | jq -r .html_url)" >> body.md | ||
|
||
for b in main develop; do | ||
echo -e "\n--- Create PR to $b ---" | ||
|
||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/{owner}/{repo}/pulls \ | ||
-f title="$TITLE to $b" \ | ||
-f body="Created by GitHub Actions Bot" \ | ||
-f head="$BRANCH" \ | ||
-f base="$b" > pr-$b.json | ||
|
||
echo -e "\n--- Update PR to $b with description ---" | ||
|
||
PR_ID=$(cat pr-$b.json | jq -r .number) | ||
|
||
gh api \ | ||
--method PATCH \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/{owner}/{repo}/pulls/$PR_ID \ | ||
-F 'body=@body.md' | ||
|
||
# clean up temp files | ||
# rm pr-$b.json | ||
done | ||
|
||
echo -e "\n--- Done ---" | ||
# clean up temp files | ||
# rm release.json | ||
# rm body.md |
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
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
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
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
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
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
Oops, something went wrong.