7
7
branches : [main]
8
8
9
9
jobs :
10
- Build :
11
- name : Build
12
- runs-on : ubuntu-latest
13
- outputs :
14
- GitVersion_SemVer : ${{ steps.GitVersion.outputs.GitVersion_SemVer }}
15
- steps :
16
- - name : Checkout
17
- uses : actions/checkout@v4
18
- with :
19
- fetch-depth : 0 # Full depth (not shallow) for GitVersion and better relevancy of Sonar analysis
20
-
21
- - name : Set up GitVersion
22
- uses :
gittools/actions/gitversion/[email protected]
23
- with :
24
- versionSpec : 6.x
25
-
26
- - name : Execute GitVersion
27
- id : GitVersion
28
- uses :
gittools/actions/gitversion/[email protected]
29
- with :
30
- overrideConfig : |
31
- workflow=GitHubFlow/v1
32
- mode=ContinuousDeployment
33
-
34
- - name : Use Node.js
35
- uses : actions/setup-node@v4
36
- with :
37
- cache : npm
38
- node-version-file : .node-version
39
-
40
- - name : Install
41
- run : npm ci
10
+ CiBuild :
11
+ name : CI Build
12
+ uses : connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@main
42
13
43
- - name : CI build
44
- run : npm run ci-build
45
-
46
- Test :
14
+ PipelineTests :
47
15
name : Test (${{ matrix.node }} | ${{ matrix.platform.os }})
48
16
defaults :
49
17
run :
@@ -124,14 +92,14 @@ jobs:
124
92
scripts/test.sh foo custom-config-path.config.mjs '-c .config/custom-config-path.config.mjs'
125
93
126
94
Publish :
127
- if : ${{ github.ref == 'refs/heads/main' }}
128
95
name : Publish
96
+ if : ${{ github.ref == 'refs/heads/main' }}
129
97
needs :
130
- - Build # For version variable
131
- - Test # Requires passing tests
98
+ - CiBuild # For version variable
99
+ - PipelineTests # Requires passing tests
132
100
runs-on : ubuntu-latest
133
101
env :
134
- GitVersion_SemVer : ${{needs.Build .outputs.GitVersion_SemVer }}
102
+ semVer : ${{needs.CiBuild .outputs.semVer }}
135
103
permissions :
136
104
contents : write
137
105
id-token : write
@@ -145,10 +113,10 @@ jobs:
145
113
registry-url : https://registry.npmjs.org
146
114
147
115
- name : Set version
148
- run : sed -i 's/0.0.0-gitversion/${{ env.GitVersion_SemVer }}/g' package.json
116
+ run : sed -i 's/0.0.0-gitversion/${{ env.semVer }}/g' package.json
149
117
150
118
- name : Install
151
- run : npm install
119
+ run : npm ci
152
120
153
121
- name : Publish
154
122
run : npm publish --provenance --access public
@@ -157,5 +125,5 @@ jobs:
157
125
158
126
- name : git tag
159
127
run : |
160
- git tag v${{ env.GitVersion_SemVer }}
161
- git push origin tag v${{ env.GitVersion_SemVer }}
128
+ git tag v${{ env.semVer }}
129
+ git push origin tag v${{ env.semVer }}
0 commit comments