-
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
dd145f1
commit 397020d
Showing
9 changed files
with
165 additions
and
33 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,24 @@ | ||
name: Merge Release PR | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
pr_approved: | ||
if: ${{ github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'next' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone git repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Merge PR | ||
run: | | ||
git checkout master | ||
git merge --ff origin/next | ||
git push -u origin master | ||
- uses: peter-evans/repository-dispatch@v3 | ||
with: | ||
event-type: release_master |
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,20 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
lint: | ||
name: pr-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,46 @@ | ||
name: Release PR | ||
|
||
on: | ||
push: | ||
branches: | ||
- next | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
release_pr: | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install Dependencies | ||
run: npm clean-install | ||
|
||
- name: Generate Changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set -ex | ||
echo '# Release Changes' > changes.md | ||
npx semantic-release@22.0.12 -d -p '@semantic-release/release-notes-generator' -b next | grep -v semantic-release | tee -a changes.md | ||
printf '\n---\n\n### Approve this PR to release above packages!' >> changes.md | ||
- name: Create PR | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set -ex | ||
export PR_NUMBER=$(gh pr list -B master -H next --json number | jq -r '.[0].number') | ||
if [[ "$(git rev-parse origin/master)" == "$(git rev-parse origin/next)" ]]; then exit 0; fi | ||
if [[ "$PR_NUMBER" == "null" ]]; then gh pr create -B master -H next -t "chore: release" -F changes.md; fi | ||
if [[ "$PR_NUMBER" != "null" ]]; then gh pr edit $PR_NUMBER -F changes.md; fi |
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,49 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
types: [release_master] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: master | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install Dependencies | ||
run: npm clean-install | ||
|
||
- name: Git Config | ||
run: | | ||
git config --global user.email "bot@restorecommerce.io" | ||
git config --global user.name "Restorecommerce Bot" | ||
- name: Build | ||
run: npm run build --verbose | ||
|
||
- name: NPM Token | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc | ||
- name: Release | ||
run: npx publish --no-verify-access --no-private --conventional-commits --yes --loglevel debug | ||
|
||
- name: Sync next branch | ||
run: | | ||
git checkout next | ||
git merge master | ||
git push -u origin next |
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,12 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [ "$BRACH" = "main" ] | ||
then | ||
echo "committing directly to main is blocked" | ||
exit 1 | ||
fi | ||
|
||
./node_modules/.bin/commitlint -e $1 |
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 @@ | ||
20.11.1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,6 @@ | |
"build": "npm-run-all lint build:clean build:tsc" | ||
}, | ||
"engines": { | ||
"node": ">= 18.8.0" | ||
"node": ">= 20.0.0" | ||
} | ||
} |