Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": "@changesets/cli/changelog",
"changelog": [
"@changesets/changelog-github",
{ "repo": "neuledge/context" }
],
"commit": false,
"fixed": [],
"linked": [],
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.27.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup Turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Build
run: pnpm build

- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm versions
publish: pnpm -r publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Tag releases
if: steps.changesets.outputs.published == 'true'
run: pnpm tags
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"prepare": "npm run build",
"changeset": "changeset",
"versions": "changeset version",
"release": "npm login && pnpm -r publish && pnpm tags",
"release": "pnpm build && pnpm -r publish && pnpm tags",
"tags": "pnpm -r exec -- bash -c 'pkg=$(jq -r .name package.json); ver=$(jq -r .version package.json); tag=\"$pkg@$ver\"; if ! git rev-parse \"$tag\" >/dev/null 2>&1; then git tag \"$tag\" && echo \"Tagged $tag\"; fi' && git push --tags"
},
"devDependencies": {
"@biomejs/biome": "2.3.10",
"@changesets/changelog-github": "^0.6.0",
"@changesets/cli": "^2.29.8",
"turbo": "^2.6.3"
},
Expand Down
67 changes: 67 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.