Skip to content

Commit

Permalink
Add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Siilwyn committed Jul 29, 2023
1 parent dfc6add commit b24be69
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on: pull_request
jobs:
main:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3

Expand All @@ -22,7 +23,7 @@ jobs:
restore-keys: npm-

- name: Install dependencies
run: npm ci --ignore-scripts
run: npm ci --ignore-scripts --no-audit --no-fund

- run: npm run test

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Package

on:
push:
tags:
- 'v**'

jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Use dependencies cache
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --no-fund

- name: Publish package
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

0 comments on commit b24be69

Please sign in to comment.