-
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (56 loc) · 1.93 KB
/
changesets.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
name: Changesets
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Changesets
runs-on: ubuntu-latest
steps:
- name: Clone settings
run: |
git config --global core.eol lf
git config --global core.autocrlf false
- name: Clone repository
uses: actions/checkout@v4
- name: Reset files
run: |
git clean -ffdx && git reset --hard HEAD
- name: Install PNPM
uses: pnpm/action-setup@v3
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install PNPM
run: corepack enable pnpm
- name: Install dependencies
run: pnpm install
- id: versions
name: Check versions
run: |
export HUSKY=0
PACKAGE_VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json').toString()).version)")
echo "current_version=${PACKAGE_VERSION}" > $GITHUB_OUTPUT
pnpm changeset version
PACKAGE_VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json').toString()).version)")
echo "next_version=${PACKAGE_VERSION}" > $GITHUB_OUTPUT
- name: Pull Request
uses: peter-evans/create-pull-request@v6
if: steps.versions.outputs.current_version != steps.versions.outputs.next_version
with:
title: Apply changesets (v${{ steps.versions.outputs.next_version }})
author: João <[email protected]>
committer: Black Rabbit <[email protected]>
commit-message: "chore(ver): applies all changesets"
body: |
This applies all pending changesets for the next release.
branch: release
delete-branch: true
assignees: wolfulus
labels: release