Skip to content

Commit 7fcd091

Browse files
authored
➕ connorjs/github-workflows, use npm-ci-build (#31)
Replaces in-repo CI Build job with `npm-ci-build~v1` from `connorjs/github-worfklows`. Applies other changes to match published style conventions from that repo. +semver:none
1 parent bf68221 commit 7fcd091

File tree

1 file changed

+12
-44
lines changed

1 file changed

+12
-44
lines changed

.github/workflows/pipeline.yaml

+12-44
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,11 @@ on:
77
branches: [main]
88

99
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
4213

43-
- name: CI build
44-
run: npm run ci-build
45-
46-
Test:
14+
PipelineTests:
4715
name: Test (${{ matrix.node }} | ${{ matrix.platform.os }})
4816
defaults:
4917
run:
@@ -124,14 +92,14 @@ jobs:
12492
scripts/test.sh foo custom-config-path.config.mjs '-c .config/custom-config-path.config.mjs'
12593
12694
Publish:
127-
if: ${{ github.ref == 'refs/heads/main' }}
12895
name: Publish
96+
if: ${{ github.ref == 'refs/heads/main' }}
12997
needs:
130-
- Build # For version variable
131-
- Test # Requires passing tests
98+
- CiBuild # For version variable
99+
- PipelineTests # Requires passing tests
132100
runs-on: ubuntu-latest
133101
env:
134-
GitVersion_SemVer: ${{needs.Build.outputs.GitVersion_SemVer}}
102+
semVer: ${{needs.CiBuild.outputs.semVer}}
135103
permissions:
136104
contents: write
137105
id-token: write
@@ -145,10 +113,10 @@ jobs:
145113
registry-url: https://registry.npmjs.org
146114

147115
- 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
149117

150118
- name: Install
151-
run: npm install
119+
run: npm ci
152120

153121
- name: Publish
154122
run: npm publish --provenance --access public
@@ -157,5 +125,5 @@ jobs:
157125

158126
- name: git tag
159127
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

Comments
 (0)