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
9 changes: 8 additions & 1 deletion .github/workflows/reusable-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
required: true
type: boolean
default: true
release_tag:
description: 'npmjs.com or/and github packages release tag - defaults to latest'
required: false
default: 'latest'
type: string
secrets:
githubPackagesToken:
required: true
Expand Down Expand Up @@ -96,10 +101,12 @@ jobs:
# requires connecting to GitHub repo and workflow in package settings in npmjs.com
- name: release-and-publish-to-npm
if: ${{ inputs.release_to_npm }}
env:
TAG: ${{ inputs.release_tag }}
run: |
version=$(cat package.json | jq -r .version)
if [[ $version == *-* ]]; then
echo "$version is tagged... Skipping publishing to npmjs"
else
npm publish --access public --registry https://registry.npmjs.org --verbose
npm publish --tag $TAG --access public --registry https://registry.npmjs.org --verbose
fi
Loading