-
Notifications
You must be signed in to change notification settings - Fork 33
74 lines (62 loc) · 1.8 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
74
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., patch, minor, major, or specific version)'
required: true
default: 'patch'
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install global dependencies
run: |
npm install -g lerna typescript
- name: Install dependencies
run: |
npm install
lerna bootstrap
- name: Run tests
run: npm test
- name: Build packages
run: npm run build
- name: Generate changelog
run: npm run changelog
- name: Configure Git
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Bump version and publish
if: github.event_name == 'workflow_dispatch'
run: |
lerna version ${{ github.event.inputs.version }} --yes --no-push
lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish packages
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
body_path: CHANGELOG.md
files: |
packages/**/*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}