-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ./scripts/create-release.sh * use negate for regEx and update script name * create-release-pr * add deleted bits back * remove node -v * use metamaskbot * remove with
- Loading branch information
1 parent
6b74684
commit 2daaf1d
Showing
2 changed files
with
77 additions
and
0 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,41 @@ | ||
name: Create Release Pull Request | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
base-branch: | ||
description: 'The base branch for git operations and the pull request.' | ||
default: 'main' | ||
required: true | ||
semver-version: | ||
description: 'A SemVer version.' | ||
required: true | ||
version-number: | ||
description: 'A specific version.' | ||
required: true | ||
|
||
jobs: | ||
create-release-pr: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get Node.js version | ||
id: nvm | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvm.outputs.NODE_VERSION }} | ||
- name: Set Versions | ||
id: set-versions | ||
shell: bash | ||
run: SEMVER_VERSION=${{ github.event.inputs.semver-version }} VERSION_NUMBER=${{ github.event.inputs.version-number }} yarn create-release | ||
- name: Create Release PR | ||
id: create-release-pr | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
./scripts/create-release-pr.sh ${{ github.event.inputs.semver-version }} |
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
NEW_VERSION="${1}" | ||
RELEASE_BRANCH_PREFIX="release/" | ||
|
||
if [[ -z $NEW_VERSION ]]; then | ||
echo "Error: No new version specified." | ||
exit 1 | ||
fi | ||
|
||
RELEASE_BRANCH_NAME="${RELEASE_BRANCH_PREFIX}${NEW_VERSION}" | ||
RELEASE_BODY="This is the release candidate for version ${NEW_VERSION}." | ||
|
||
# maybe use metamaskbot for this? | ||
git config user.name metamaskbot | ||
git config user.email metamaskbot@users.noreply.github.com | ||
|
||
git checkout -b "${RELEASE_BRANCH_NAME}" | ||
|
||
if ! (git add . && git commit -m "${NEW_VERSION}"); | ||
then | ||
echo "Error: No changes detected." | ||
exit 1 | ||
fi | ||
|
||
git push --set-upstream origin "${RELEASE_BRANCH_NAME}" | ||
|
||
gh pr create \ | ||
--draft \ | ||
--title "${NEW_VERSION}" \ | ||
--body "${RELEASE_BODY}" \ | ||
--head "${RELEASE_BRANCH_NAME}"; |