Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

➕ connorjs/github-workflows, npm-publish #32

Merged
merged 7 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 8 additions & 28 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Loading