-
Notifications
You must be signed in to change notification settings - Fork 1
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
ae3925b
commit a212fdd
Showing
2 changed files
with
28 additions
and
8 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 |
---|---|---|
@@ -1,21 +1,41 @@ | ||
name: Release | ||
name: Release and Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Release | ||
name: Release and Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Release | ||
uses: justincy/[email protected] | ||
id: release | ||
|
||
- name: Print release output | ||
if: ${{ steps.release.outputs.released == 'true' }} | ||
run: echo Release ID ${{ steps.release.outputs.release_id }} | ||
run: echo Release ID ${{ steps.release.outputs.release_id }} | ||
|
||
# Publish to npm only if release was successful | ||
- name: Set up Node.js environment (if release successful) | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
if: ${{ steps.release.outputs.released == 'true' }} | ||
|
||
- name: Install dependencies (if release successful) | ||
run: npm ci | ||
if: ${{ steps.release.outputs.released == 'true' }} | ||
|
||
- name: Publish to npm (if release successful) | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
if: ${{ steps.release.outputs.released == 'true' }} |
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