-
Notifications
You must be signed in to change notification settings - Fork 67
113 lines (93 loc) · 3.41 KB
/
release.yml
File metadata and controls
113 lines (93 loc) · 3.41 KB
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
107
108
109
110
111
112
113
name: Release
on:
push:
branches:
- main
jobs:
release:
if: github.repository == 'toss/react-simplikit'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Enable Corepack
run: corepack enable
- name: Install Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Update npm for OIDC trusted publishing
run: npm install -g npm@latest
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn run prepack
- name: Type Check
run: yarn run test:type
- name: Create Release Pull Request
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
with:
title: 'chore: version packages'
commit: 'chore: version packages'
version: yarn run changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm
if: steps.changesets.outputs.hasChangesets == 'false'
run: yarn run changeset:publish
env:
NPM_CONFIG_PROVENANCE: true
get-diffs:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.diffs.outputs.result }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Get changed files from merged PR
id: diffs
run: |
MATCHED_NAMES=$(git diff-tree --no-commit-id --name-only -r HEAD | grep -E '^src/[^/]+/([^/]+)/\1\.tsx?$' | sed -r "s/.+\/(.+)\..+/\1/" | tr "\n" "," | sed 's/,$//')
echo $MATCHED_NAMES
echo "result=$MATCHED_NAMES" >> "$GITHUB_OUTPUT"
generate-docs:
runs-on: ubuntu-latest
needs: get-diffs
if: ${{ needs.get-diffs.outputs.result != '' }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Enable Corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Generate docs
run: |
yarn run docs:gen ${{ needs.get-diffs.outputs.result }}
yarn run fix:format
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: new-docgen-branch-${{ github.run_id }}
title: 'docs(${{ needs.get-diffs.outputs.result }}): auto-generated docs'
body: 'This PR includes documentation updates for: ${{ needs.get-diffs.outputs.result }}'
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
reviewers: kimyouknow,zztnrudzz13
commit-message: 'Generate docs for ${{ needs.get-diffs.outputs.result }}'