-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.54 KB
/
release.yml
File metadata and controls
51 lines (49 loc) · 1.54 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
name: Release
on:
push:
branches: [main]
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write # Required for OIDC
steps:
- uses: actions/checkout@v6
with: { fetch-depth: 0 }
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run build
- uses: actions/setup-node@v6
with:
node-version: '24'
- name: Create Release PR or Detect Publishable Versions
id: changesets
uses: changesets/action@v1
with:
version: bun run changeset:version
commit: "chore: release"
title: "chore: release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to npm
if: steps.changesets.outputs.hasChangesets == 'false'
working-directory: packages/classy-store
run: |
PKG_NAME=$(jq -r .name package.json)
PKG_VERSION=$(jq -r .version package.json)
if npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null; then
echo "Version ${PKG_VERSION} already published — skipping."
else
npm publish --provenance --access public
fi
- name: Create git tags
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
bunx changeset tag
git push --follow-tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}