-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (63 loc) · 2.46 KB
/
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version to release. Format vx.x.x(-[rc|beta].x)'
required: true
type: string
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm ci
- name: 'Set version in package.json files to ${{ inputs.version }}'
run: |
npm version ${{ inputs.version }} --force --no-git-tag-version
npm version ${{ inputs.version }} -w libraries/ --force --no-git-tag-version
- name: 'Commit changes to release branch'
run: |
git config user.name "GitHub action"
git config user.email "<>"
git checkout -b feature/${{ inputs.version }}
git add package*.json libraries/ui-library/package*.json libraries/ui-library-vue/package*.json libraries/ui-library-angular/package*.json
git commit -m "${{ inputs.version }}"
git push origin feature/${{ inputs.version }}
- name: 'Build project with new version'
run: npm run build
- name: 'Publish to NPM'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
npm publish --tag=latest --access=public libraries/ui-library/
npm publish --tag=latest --access=public libraries/ui-library-vue/
npm publish --tag=latest --access=public libraries/ui-library-angular/dist/ui-library-angular/
- name: 'Create tag'
run: |
git tag ${{ inputs.version }}
git push origin ${{ inputs.version }}
- name: 'Create Pull Request'
run: gh pr create -B main -H feature/${{ inputs.version }} --title 'Release ${{ inputs.version }}' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Create GitHub release'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
release_name: '${{ inputs.version }}'
body: '${{ inputs.version }}'
- name: 'Deploy Documentation'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/.vitepress/dist
target-folder: docs