Skip to content

Commit 8e84979

Browse files
committed
ci: setup release workflow
1 parent f67cf73 commit 8e84979

File tree

3 files changed

+69
-5
lines changed

3 files changed

+69
-5
lines changed

.editorconfig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ root = true
44
[*]
55
charset = utf-8
66
indent_style = space
7-
indent_size = 4
7+
indent_size = 2
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[*.json]
12-
indent_size = 2
13-
14-
[*.ts]
11+
[*.{tsx,ts,jsx,js}]
1512
quote_type = single
13+
indent_size = 4
1614

1715
[*.md]
1816
max_line_length = off

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
version:
5+
description: version
6+
required: true
7+
type: choice
8+
options:
9+
- major
10+
- minor
11+
- patch
12+
- premajor
13+
- preminor
14+
- prepatch
15+
- prerelease
16+
17+
permissions:
18+
contents: write
19+
actions: read
20+
pull-requests: read
21+
id-token: write
22+
23+
jobs:
24+
release:
25+
runs-on: buildjet-2vcpu-ubuntu-2004
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 20.6.0
34+
35+
- name: Cache node_modules
36+
uses: actions/cache@v4
37+
with:
38+
path: '**/node_modules'
39+
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
40+
41+
- name: npm install
42+
run: npm ci
43+
44+
- name: git config
45+
run: |
46+
git config user.name "${GITHUB_ACTOR}"
47+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
48+
49+
- name: lerna version
50+
run: lerna version --no-private --verify-access ${{ inputs.version }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54+
LEFTHOOK: 0
55+
56+
- name: lerna publish
57+
run: lerna publish from-git
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61+
LEFTHOOK: 0
62+

lerna.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"!packages/framework-examples"
77
],
88
"command": {
9+
"version": {
10+
"allowBranch": "master",
11+
"conventionalCommits": true
12+
},
913
"publish": {
1014
"conventionalCommits": true
1115
}

0 commit comments

Comments
 (0)