Skip to content
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
19 changes: 15 additions & 4 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Publish useMultiTabDetection to NPM

on:
push:
branches:
- main
release:
types: [published]

jobs:
publish:
Expand All @@ -21,7 +20,7 @@ jobs:
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"

scope: "@tabbridge"
- name: Install dependencies
run: npm ci

Expand Down Expand Up @@ -52,6 +51,18 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create package tarball
if: steps.check-version.outputs.skip == 'false'
run: npm pack

- name: Upload package to release
if: steps.check-version.outputs.skip == 'false'
uses: softprops/action-gh-release@v1
with:
files: "*.tgz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Skip publishing
if: steps.check-version.outputs.skip == 'true'
run: echo "Skipping publish - version already exists on NPM"