-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.39 KB
/
release.yml
File metadata and controls
52 lines (43 loc) · 1.39 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
name: Release
on:
push:
branches: [main]
paths:
- 'types/**/CHANGELOG.md'
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
- name: Install Pnpm
uses: pnpm/action-setup@v4
- name: Install Dependencies
run: pnpm install
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v47
with:
files: |
types/**/CHANGELOG.md
- name: Get Package Name
id: package-name
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
PACKAGE=$(echo "$file" | sed -E 's|types/(.+)/CHANGELOG\.md|\1|')
PACKAGES="$PACKAGES $PACKAGE"
done
PACKAGES=$(echo $PACKAGES | tr ' ' '\n' | sort -u | tr '\n' ' ' | xargs)
echo "package=$PACKAGES" >> $GITHUB_OUTPUT
- name: Push to Package Branch
run: |
git subtree split --prefix=types/${{ steps.package-name.outputs.package }} -b ${{ steps.package-name.outputs.package }}
git push origin ${{ steps.package-name.outputs.package }} --force