-
Notifications
You must be signed in to change notification settings - Fork 11
106 lines (91 loc) · 3.31 KB
/
pre-release.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Publishes a branch as a pre-release version to npm
on:
workflow_dispatch:
inputs:
change_type:
description: 'Determines which part of the version to increment (major, minor, patch)'
required: true
default: 'minor'
type: choice
options:
- major
- minor
- patch
preview_version:
description: 'Number at the end of the version string (3.0.0-preview.X). Increment by 1 for each pre-release version.'
required: true
type: string
default: '0'
name: pre-release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: set-vivid-version
working-directory: ./libs/components
run: |
npm version ${{ github.event.inputs.change_type }} --no-git-tag-version
VERSION=$(node -p "require('./package.json').version")-preview.${{ github.event.inputs.preview_version }}
npm version $VERSION --no-git-tag-version
- name: sync-vivid-vue-version
working-directory: ./libs/vue-wrappers
run: |
npm version $(node -p "require('../components/package.json').version") --no-git-tag-version
- name: build
run: |
npm ci --ignore-scripts
npx nx run components:build
npx nx run components:generateMeta
npx nx run vue-wrappers:build
- name: upload-artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: dist/
npm-publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Download Build
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: dist/
- name: publish vivid npm package
run: npm publish --tag preview dist/libs/components --//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_VVD_VNG_AUTOMATION_TOKEN }}
- name: publish vivid-vue npm package
run: npm publish --tag preview dist/libs/vue-wrappers --//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_VVD_VNG_AUTOMATION_TOKEN }}
github-publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Download Build
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: dist/
- name: publish vivid to github packages
run: npm publish --tag preview ./dist/libs/components --registry=https://npm.pkg.github.com --//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.VNG_VVD_PAT }}
- name: publish vivid-vue to github packages
run: npm publish --tag preview ./dist/libs/vue-wrappers --registry=https://npm.pkg.github.com --//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.VNG_VVD_PAT }}