Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish zrok NodeJS SDK only when a zrok Release is created #614

Merged
merged 1 commit into from
May 1, 2024
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
29 changes: 2 additions & 27 deletions .github/workflows/node-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: Build/Release Node SDK
on:
release:
types: [ published ]
push:
branches: [ main ]
paths-ignore:
- 'package.json'
- 'CHANGELOG.md'
pull_request:
branches: [ main ]

Expand Down Expand Up @@ -50,20 +45,6 @@ jobs:
run: |
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
npm version ${{ steps.tag.outputs.TAG }} --no-git-tag-version --allow-same-version
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "Update package.json version to ${{ steps.tag.outputs.TAG }}" || echo "No changes to commit"

- name: Push changes to zrok NodeJS-SDK's package.json
if: github.ref == 'refs/heads/main'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

- name: Pull newly bumped zrok NodeJS-SDK semver
if: github.ref == 'refs/heads/main'
run: git pull

- name: Setup .npmrc
if: github.ref == 'refs/heads/main'
Expand All @@ -81,17 +62,11 @@ jobs:
env:
BUILD_DATE: ${{ steps.date.outputs.date }}

- name: Publish production release
if: github.ref == 'refs/heads/main'
- name: NPM Publish
if: github.ref_type == 'tag'
run: |
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: NPM Publish
if: github.ref == 'refs/heads/main'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
Loading