-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3730a1
commit 1100cf5
Showing
5 changed files
with
71 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Publish Package to npmjs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
vue-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20.x" | ||
registry-url: "https://registry.npmjs.org" | ||
- run: | | ||
cd vue | ||
npm ci | ||
npm run build | ||
# Check if the version already exists on npm | ||
- name: Check Version Existence | ||
id: check_version | ||
run: | | ||
if npm show @canopassoftware/[email protected]; then | ||
echo "Version already published. Skipping npm publish." | ||
echo "::set-output name=skip_publish::true" | ||
else | ||
echo "::set-output name=skip_publish::false" | ||
fi | ||
# Publish only if the version check passed | ||
- name: Publish to npm | ||
if: steps.check_version.outputs.skip_publish != 'true' | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
react-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20.x" | ||
registry-url: "https://registry.npmjs.org" | ||
- run: | | ||
cd react | ||
npm ci | ||
npm run build | ||
# Check if the version already exists on npm | ||
- name: Check Version Existence | ||
id: check_version | ||
run: | | ||
if npm show @canopassoftware/[email protected]; then | ||
echo "Version already published. Skipping npm publish." | ||
echo "::set-output name=skip_publish::true" | ||
else | ||
echo "::set-output name=skip_publish::false" | ||
fi | ||
# Publish only if the version check passed | ||
- name: Publish to npm | ||
if: steps.check_version.outputs.skip_publish != 'true' | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters