Skip to content

enh: add workflow_dispatch trigger for publish action #3

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

Closed
wants to merge 3 commits into from
Closed
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
11 changes: 7 additions & 4 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main

workflow_dispatch:
jobs:
publish-npm:
runs-on: ubuntu-latest
Expand All @@ -14,13 +14,13 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2 # Fetch the current and the previous commit
fetch-depth: 2 # Fetch the current and the previous commit
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.17
registry-url: https://registry.npmjs.org/
scope: '@devrev'
scope: "@devrev"
token: ${{ secrets.NPMJS_NPM_TOKEN }}

- run: npm ci
Expand All @@ -35,8 +35,11 @@ jobs:
echo "Version $CURRENT_VERSION has not been changed"
echo "version_bumped=false" >> "$GITHUB_ENV"
fi
- name: Set version_bumped to true if workflow_dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "version_bumped=true" >> "$GITHUB_ENV"
- name: Publish to registry
if: ${{ env.version_bumped == 'true' }}
run: npm publish --verbose --access public
run: npm publish --verbose --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_NPM_TOKEN}}
Loading