Skip to content

Commit abd9c3a

Browse files
authored
➕ connorjs/github-workflows, npm-publish (#32)
Replaces in-repo Publish job with shared `npm-publish~v1`. +semver:skip
1 parent 7fcd091 commit abd9c3a

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

.github/workflows/pipeline.yaml

+8-28
Original file line numberDiff line numberDiff line change
@@ -93,37 +93,17 @@ jobs:
9393
9494
Publish:
9595
name: Publish
96-
if: ${{ github.ref == 'refs/heads/main' }}
9796
needs:
9897
- CiBuild # For version variable
9998
- PipelineTests # Requires passing tests
100-
runs-on: ubuntu-latest
101-
env:
102-
semVer: ${{needs.CiBuild.outputs.semVer}}
99+
100+
uses: connorjs/github-workflows/.github/workflows/npm-publish~v1.yaml@main
101+
with:
102+
npmPackFilename: ${{ needs.CiBuild.outputs.npmPackFilename }}
103+
semVer: ${{ needs.CiBuild.outputs.semVer }}
104+
secrets:
105+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
106+
103107
permissions:
104108
contents: write
105109
id-token: write
106-
steps:
107-
- uses: actions/checkout@v4
108-
109-
- uses: actions/setup-node@v4
110-
with:
111-
cache: npm
112-
node-version-file: .node-version
113-
registry-url: https://registry.npmjs.org
114-
115-
- name: Set version
116-
run: sed -i 's/0.0.0-gitversion/${{ env.semVer }}/g' package.json
117-
118-
- name: Install
119-
run: npm ci
120-
121-
- name: Publish
122-
run: npm publish --provenance --access public
123-
env:
124-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
125-
126-
- name: git tag
127-
run: |
128-
git tag v${{ env.semVer }}
129-
git push origin tag v${{ env.semVer }}

0 commit comments

Comments
 (0)