File tree 9 files changed +165
-33
lines changed
9 files changed +165
-33
lines changed Original file line number Diff line number Diff line change
1
+ name : Merge Release PR
2
+
3
+ on :
4
+ pull_request_review :
5
+ types : [submitted]
6
+
7
+ jobs :
8
+ pr_approved :
9
+ if : ${{ github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'next' }}
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Clone git repo
13
+ uses : actions/checkout@v4
14
+ with :
15
+ fetch-depth : 0
16
+
17
+ - name : Merge PR
18
+ run : |
19
+ git checkout master
20
+ git merge --ff origin/next
21
+ git push -u origin master
22
+ - uses : peter-evans/repository-dispatch@v3
23
+ with :
24
+ event-type : release_master
Original file line number Diff line number Diff line change 1
- name : build
1
+ name : Build
2
2
3
3
on : push
4
4
5
5
jobs :
6
6
build :
7
- runs-on : ubuntu-20 .04
7
+ runs-on : ubuntu-22 .04
8
8
steps :
9
- - name : Checkout
10
- uses : actions/checkout@v2
9
+ - uses : actions/checkout@v4
11
10
12
- - name : Setup NodeJS
13
- uses : actions/setup-node@v1
11
+ - uses : actions/setup-node@v4
14
12
with :
15
- node-version : ' 20.8.0 '
13
+ node-version-file : ' .nvmrc '
16
14
17
15
- name : Install Dependencies
18
16
run : npm ci
@@ -21,29 +19,23 @@ jobs:
21
19
run : npm run build
22
20
23
21
test :
24
- runs-on : ubuntu-20 .04
22
+ runs-on : ubuntu-22 .04
25
23
needs : build
26
24
steps :
27
- - name : Checkout
28
- uses : actions/checkout@v2
25
+ - uses : actions/checkout@v4
29
26
30
- - name : Setup NodeJS
31
- uses : actions/setup-node@v1
27
+ - uses : actions/setup-node@v4
32
28
with :
33
- node-version : ' 20.8.0 '
29
+ node-version-file : ' .nvmrc '
34
30
35
- - name : Setup System
36
- uses : restorecommerce/setup-system-action@v1
37
- with :
38
- backing-only : true
31
+ - uses : restorecommerce/setup-system-action@v1
39
32
40
33
- name : Install Dependencies
41
34
run : npm ci
42
35
43
36
- name : Test
44
37
run : npm run test && npm run lcov-report
45
38
46
- - name : Coveralls
47
- uses : coverallsapp/github-action@master
39
+ - uses : coverallsapp/github-action@master
48
40
with :
49
41
github-token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ name : " Lint PR"
2
+
3
+ on :
4
+ pull_request_target :
5
+ types :
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ permissions :
11
+ pull-requests : read
12
+
13
+ jobs :
14
+ lint :
15
+ name : pr-lint
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - uses : amannn/action-semantic-pull-request@v5
19
+ env :
20
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ name : Release PR
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - next
7
+
8
+ permissions :
9
+ contents : read
10
+
11
+ jobs :
12
+ release_pr :
13
+ permissions :
14
+ issues : write
15
+ pull-requests : write
16
+ contents : write
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - uses : actions/checkout@v4
20
+ with :
21
+ fetch-depth : 0
22
+
23
+ - uses : actions/setup-node@v4
24
+ with :
25
+ node-version-file : ' .nvmrc'
26
+
27
+ - name : Install Dependencies
28
+ run : npm clean-install
29
+
30
+ - name : Generate Changes
31
+ env :
32
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33
+ run : |
34
+ set -ex
35
+ echo '# Release Changes' > changes.md
36
+ npx [email protected] -d -p '@semantic-release/release-notes-generator' -b next | grep -v semantic-release | tee -a changes.md
37
+ printf '\n---\n\n### Approve this PR to release above packages!' >> changes.md
38
+ - name : Create PR
39
+ env :
40
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41
+ run : |
42
+ set -ex
43
+ export PR_NUMBER=$(gh pr list -B master -H next --json number | jq -r '.[0].number')
44
+ if [[ "$(git rev-parse origin/master)" == "$(git rev-parse origin/next)" ]]; then exit 0; fi
45
+ if [[ "$PR_NUMBER" == "null" ]]; then gh pr create -B master -H next -t "chore: release" -F changes.md; fi
46
+ if [[ "$PR_NUMBER" != "null" ]]; then gh pr edit $PR_NUMBER -F changes.md; fi
Original file line number Diff line number Diff line change
1
+ name : Release
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ workflow_dispatch :
8
+ types : [release_master]
9
+
10
+ jobs :
11
+ release :
12
+ runs-on : ubuntu-22.04
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v4
16
+ with :
17
+ fetch-depth : 0
18
+ ref : master
19
+
20
+ - name : Setup NodeJS
21
+ uses : actions/setup-node@v4
22
+ with :
23
+ node-version-file : ' .nvmrc'
24
+
25
+ - name : Install Dependencies
26
+ run : npm clean-install
27
+
28
+ - name : Git Config
29
+ run : |
30
+ git config --global user.email "[email protected] "
31
+ git config --global user.name "Restorecommerce Bot"
32
+
33
+ - name : Build
34
+ run : npm run build --verbose
35
+
36
+ - name : NPM Token
37
+ env :
38
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
39
+ run : |
40
+ echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc
41
+
42
+ - name : Release
43
+ run : npx publish --no-verify-access --no-private --conventional-commits --yes --loglevel debug
44
+
45
+ - name : Sync next branch
46
+ run : |
47
+ git checkout next
48
+ git merge master
49
+ git push -u origin next
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+ . " $( dirname -- " $0 " ) /_/husky.sh"
3
+
4
+ BRANCH=$( git rev-parse --abbrev-ref HEAD)
5
+
6
+ if [ " $BRACH " = " main" ]
7
+ then
8
+ echo " committing directly to main is blocked"
9
+ exit 1
10
+ fi
11
+
12
+ ./node_modules/.bin/commitlint -e $1
Original file line number Diff line number Diff line change
1
+ 20.11.1
Original file line number Diff line number Diff line change 65
65
"build" : " npm-run-all lint build:clean build:tsc"
66
66
},
67
67
"engines" : {
68
- "node" : " >= 18.8 .0"
68
+ "node" : " >= 20.0 .0"
69
69
}
70
70
}
You can’t perform that action at this time.
0 commit comments