File tree Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,10 @@ jobs:
1818 with :
1919 GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
2020
21- # Job that runs on PR (before merge)
22- pr-checks :
23- if : github.event_name == 'pull_request'
21+ # Job that runs for both PR and merge
22+ ci-checks :
2423 runs-on : ubuntu-latest
25- name : PR Checks
24+ name : CI Checks (Build, Lint, Test, Release Dry-Run)
2625 steps :
2726 - name : Checkout code
2827 uses : actions/checkout@v4
@@ -62,17 +61,31 @@ jobs:
6261 run : npx nx affected --target=test --parallel=3 --coverage
6362 continue-on-error : false
6463
65- - name : Run Nx release dry-run
64+ - name : Run Nx release dry-run (PR only)
65+ if : github.event_name == 'pull_request'
6666 run : npx nx release --first-release --dry-run --verbose
6767
68- # Job that runs after merge (on push to master)
69- post-merge :
70- if : github.event_name == 'push'
68+ # Job that runs ONLY after merge (on push to master)
69+ release :
70+ if : github.event_name != 'pull_request'
71+ needs : ci-checks
7172 runs-on : ubuntu-latest
72- name : Post-merge Actions
73+ name : Release
7374 steps :
7475 - name : Checkout code
7576 uses : actions/checkout@v4
77+ with :
78+ fetch-depth : 0
79+
80+ - name : Setup Node.js
81+ uses : actions/setup-node@v4
82+ with :
83+ node-version : ' 20'
84+ cache : ' yarn'
85+
86+ - name : Install dependencies
87+ run : yarn install --frozen-lockfile
88+
7689 - name : 🚀 Run Nx Release
7790 run : |
7891 npx nx release --first-release --skip-publish --verbose
You can’t perform that action at this time.
0 commit comments