Merge pull request #89 from morganstanley/dependabot/github_actions/o… #20
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
name: Create Release | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2.5.2 | |
with: | |
node-version: '16.x' | |
- name: Install node modules and verify build | |
run: npm ci && npm run build-release | |
- name: Release | |
if: github.repository == 'morganstanley/needle' | |
uses: justincy/github-action-npm-release@f6afd60cbb595a76ecae037ad006671636d321f5 # 2.0.2 | |
id: release | |
with: | |
token: ${{ secrets.RELEASE_TOKEN }} | |
- name: Print release output | |
if: ${{ steps.release.outputs.released == 'true' }} | |
run: echo Release ID ${{ steps.release.outputs.release_id }} | |
- name: Publish | |
if: steps.release.outputs.released == 'true' | |
uses: JS-DevTools/npm-publish@0f451a94170d1699fd50710966d48fb26194d939 # v1.4.3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} |