-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.7 KB
/
release.yml
File metadata and controls
51 lines (44 loc) · 1.7 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
# [Changesets](https://github.com/changesets/changesets): open a "Version packages" PR when
# `.changeset/*.md` files land on `main`, then publish to npm when that PR merges (requires `NPM_TOKEN`).
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
# Opens/updates the Version PR when `.changeset/*.md` exist. When there are none, the action
# can still run `publish` (see changesets/action) so a just-merged Version PR can ship.
# `changeset publish` should exit 0 when there is nothing new to publish. If this job fails,
# read the step log: common causes are missing/invalid NPM_TOKEN, registry/network errors, or
# a real publish failure — not assumed from the runner alone.
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# Runs `changeset version` then oxfmt on CHANGELOG.md so `format:check` passes (see docs/packaging.md).
version: bun run version
publish: bun run release
title: "chore: version packages"
commit: "chore: version packages"
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}