Skip to content

Commit

Permalink
chore: publish update
Browse files Browse the repository at this point in the history
  • Loading branch information
damienen authored May 13, 2024
1 parent d616ea6 commit 36fca91
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
name: Publish

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write

jobs:
release:
name: Release
publish-npm:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: lts/*
node-version: '18.x'
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npx ci
- name: Install semantic-release extra plugins
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
- name: Lint
run: npm run lint:fix
- name: Test
run: npm run test --if-present
- name: Build
run: npm run build
- name: Release
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm config set access public && npx semantic-release
run: |
RELEASE_TAG=v$(node -p "require('./package.json').version")
gh release create $RELEASE_TAG --target=$GITHUB_SHA --title="$RELEASE_TAG" --generate-notes
- name: Publish to npmjs
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish --access=public

0 comments on commit 36fca91

Please sign in to comment.