Skip to content

Commit

Permalink
Added a publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Jun 5, 2024
1 parent 0758c80 commit fe0f95c
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Publish"
on:
release:
types: [published]

env:
cache-version: 1

jobs:
build:
name: "Build & publish"
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: "Checkout"
uses: actions/[email protected]

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

- name: "Install NPM dependencies"
run: |
npm ci
- name: "Build"
env:
NODE_ENV: 'production'
run: |
npm run build
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: "build-artifact"
path: |
dist
LICENSE
package.json
README.md
- name: "Publish"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
npm publish --provenance

0 comments on commit fe0f95c

Please sign in to comment.