Skip to content

Publish pre-release #47

Publish pre-release

Publish pre-release #47

name: Publish pre-release
on:
workflow_dispatch:
inputs:
versionType:
required: true
type: choice
options:
- premajor
- preminor
- prepatch
- prerelease
env:
NODE_VERSION: 16.x
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository_owner == 'AxaFrance'
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PUSH_PAT }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run check
- run: |
git config user.name "Build-CI"
git config user.email [email protected]
- name: Create new ${{ inputs.versionType }} release
run: npx lerna version ${VERSION_TYPE} --exact --force-publish --yes --no-push
env:
VERSION_TYPE: ${{ inputs.versionType }}
- run: |
git push
git push --tags origin
- name: Publish ${{ inputs.versionType }} release packages to npm
run: npx lerna publish from-package --dist-tag next --yes --registry https://registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}