diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 2f78f97..039a6da 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -93,37 +93,17 @@ jobs: Publish: name: Publish - if: ${{ github.ref == 'refs/heads/main' }} needs: - CiBuild # For version variable - PipelineTests # Requires passing tests - runs-on: ubuntu-latest - env: - semVer: ${{needs.CiBuild.outputs.semVer}} + + uses: connorjs/github-workflows/.github/workflows/npm-publish~v1.yaml@main + with: + npmPackFilename: ${{ needs.CiBuild.outputs.npmPackFilename }} + semVer: ${{ needs.CiBuild.outputs.semVer }} + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + permissions: contents: write id-token: write - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: npm - node-version-file: .node-version - registry-url: https://registry.npmjs.org - - - name: Set version - run: sed -i 's/0.0.0-gitversion/${{ env.semVer }}/g' package.json - - - name: Install - run: npm ci - - - name: Publish - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: git tag - run: | - git tag v${{ env.semVer }} - git push origin tag v${{ env.semVer }}