-
Notifications
You must be signed in to change notification settings - Fork 6
98 lines (95 loc) · 3.29 KB
/
release.yaml
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
name: Release
on:
workflow_dispatch:
inputs:
release-type:
type: choice
required: true
description: 'Release type:'
default: 'patch'
options:
- 'patch'
- 'minor'
- 'major'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: 'pnpm'
- name: Install workspace
run: pnpm install
- name: Update version for all packages
run: |
echo "NEW_VERSION=$(pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false)" >> $GITHUB_ENV
cd packages/prez-lib
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd ../prez-components
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd ../prez-ui
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd ../create-prez-app
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
cd template
pnpm version ${{ github.event.inputs.release-type }} --git-tag-version false
# prez-lib
- name: Build prez-lib
working-directory: packages/prez-lib
run: pnpm build
- name: Publish prez-lib to NPM
working-directory: packages/prez-lib
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
# prez-components
- name: Build prez-components
working-directory: packages/prez-components
run: pnpm build
- name: Publish prez-components to NPM
working-directory: packages/prez-components
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
# prez-ui layer
- name: Publish prez-ui to NPM
working-directory: packages/prez-ui
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
# create-prez-app
- name: Update prez-ui dependency in template
working-directory: packages/create-prez-app/template
run: pnpm up prez-ui
- name: Publish create-prez-app to NPM
working-directory: packages/create-prez-app
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --no-git-checks
- name: Git configuration
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
- name: Commit & push changes with tag
run: |
git add -A
git commit -m "chore: release ${{ env.NEW_VERSION }}"
git tag ${{ env.NEW_VERSION }}
git push origin && git push --tags
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.NEW_VERSION }}
generate_release_notes: true