-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (41 loc) · 1.31 KB
/
changesets.yml
File metadata and controls
47 lines (41 loc) · 1.31 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
name: Changesets PR
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
changesets:
name: Changesets PR
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write
pull-requests: write
issues: read
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- run: bun i
- name: Get next version
id: version
run: |
bunx changeset status --output=$RUNNER_TEMP/changeset-status.json
VERSION=$(jq -r '.releases[0].newVersion // empty' $RUNNER_TEMP/changeset-status.json)
echo "next=${VERSION:+v$VERSION}" >> "$GITHUB_OUTPUT"
- uses: changesets/action@v1
id: changesets
with:
publish: bunx changeset publish
commit: "chore: release ${{ steps.version.outputs.next }}"
title: "chore: release ${{ steps.version.outputs.next }}"
commitMode: github-api
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Label release PR
if: steps.changesets.outputs.published != 'true'
run: gh pr edit changeset-release/main --add-label "release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}