-
Notifications
You must be signed in to change notification settings - Fork 62
48 lines (45 loc) · 1.34 KB
/
pre-release-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 }}