Skip to content

Updating workflow job name. #55

Updating workflow job name.

Updating workflow job name. #55

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
on:
push:
branches:
- 'main'
release:
types: [published]
env:
# See LTS versions supported: https://nodejs.org/en/about/releases/
NODE_VERSION: 16
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- run: npm ci
- run: npm run release
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
publish-preview:
needs: build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v2
- name: Download dist
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org/'
- run: npm version preminor --preid preview.${GITHUB_SHA::8}+${GITHUB_RUN_NUMBER} --no-git-tag-version
- run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
publish-release:
needs: build
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- uses: actions/checkout@v2
- name: Download dist
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org/'
- name: Set environment variables
uses: FranzDiebold/github-env-vars-action@v2
- run: npm version ${{ env.CI_ACTION_REF_NAME }} --no-git-tag-version
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- name: Bump version
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -am "Bumping version"
git push