v0.0.4-rc #6
Workflow file for this run
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: Publish to NPM | ||
on: | ||
release: | ||
types: | ||
- published | ||
- created | ||
jobs: | ||
publish: | ||
name: Publish to NPM | ||
runs-on: ubuntu-latest | ||
env: | ||
RC_VERSION: ${{ steps.check_rc_version.outputs.rc_version }} | ||
Check failure on line 14 in .github/workflows/publish-npmjs.yaml GitHub Actions / Publish to NPMInvalid workflow file
|
||
steps: | ||
- name: Check RC version | ||
id: check_rc_version | ||
run: echo "::set-output name=rc_version::$(echo ${{ github.event.release.tag_name }} | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+$' || echo 'false')" | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' | ||
registry-url: 'https://registry.npmjs.org' | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' # You can adjust the Node.js version according to your needs | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Bump Version | ||
run: | | ||
initialTag=${{ github.event.release.tag_name }} | ||
tag="${initialTag//[v]/}" | ||
./bump-version.sh $tag ${{ env.RC_VERSION }} | ||
- name: Build library | ||
run: npm run build | ||
- name: Publish to NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
if [ "${{ env.RC_VERSION }}" == "true" ]; then | ||
echo "🚀 Publishing RC version..." | ||
./publish.sh --tag "${{ github.event.release.tag_name }}" | ||
else | ||
echo "🚀 Publishing regular version..." | ||
./publish.sh | ||
fi |