Skip to content

Commit

Permalink
ci: actions split to release and npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubrekowski committed Oct 21, 2024
1 parent 45e29b1 commit 1b6a821
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish NPM Package

on:
release:
types: [published]

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org/'

- name: Install dependencies
run: npm ci

- name: Build the package
run: npm run build

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 1 addition & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,4 @@ jobs:
with:
release-type: node
package-name: interpol.ts
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm
if: ${{ steps.release.outcome == 'success' && steps.release.outputs.release_created == 'true' }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
token: ${{ secrets.AUTOMATE_TOKEN }}

0 comments on commit 1b6a821

Please sign in to comment.