Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): support changeset #73

Merged
merged 2 commits into from
Dec 21, 2024
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "eryue0220/unplugin-stylex" }],
"access": "public",
"commit": false,
"linked": [],
"baseBranch": "origin/main",
"updateInternalDependencies": "patch",
"ignore": ["examples"]
}
19 changes: 19 additions & 0 deletions .github/workflows/release-jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release JSR

on:
push:
branches:
- main

jobs:
release:
name: Release JSR
if: github.repository == 'eryue0220/unplugin-stylex'
permissions:
contents: read
pull-requests: write
id-token: write # The OIDC ID token is used for authentication with JSR.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx jsr publish
48 changes: 48 additions & 0 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release NPM

on:
push:
branches:
- main

jobs:
release:
name: Release NPM
if: github.repository == 'eryue0220/unplugin-stylex'
permissions:
contents: write
id-token: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PNPM
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"

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

- name: Build Packages
run: pnpm build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: pnpm run changeset:version
commit: "chore: Update version for release"
title: "chore: Update version for release"
publish: pnpm run changeset:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: false
# Needs access to publish to npm
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39 changes: 0 additions & 39 deletions .github/workflows/release.yml

This file was deleted.

18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
"packageManager": "[email protected]",
"description": "Unplugin for stylex",
"repository": "https://github.com/eryue0220/unplugin-stylex",
"keywords": ["unplugin", "stylex", "stylex-plugin", "farm", "esbuild", "rollup", "rspack", "vite"],
"keywords": [
"unplugin",
"stylex",
"stylex-plugin",
"farm",
"esbuild",
"rollup",
"rspack",
"vite"
],
"author": "eryue0220<[email protected]>",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -62,7 +71,10 @@
"test:cov": "vitest --coverage",
"lint": "pnpm biome lint .",
"check": "pnpm biome check . --line-width=120 --quote-style=single --indent-style=space --indent-width=2 --semicolons=as-needed",
"ci": "pnpm run lint && pnpm run check"
"ci": "pnpm run lint && pnpm run check",
"changeset": "pnpm dlx @changesets/cli add",
"changeset:version": "pnpm dlx @changesets/cli version && pnpm install",
"changeset:release": "pnpm run build && pnpm dlx @changesets/cli publish"
},
"engines": {
"node": ">=16.14.0"
Expand All @@ -81,6 +93,8 @@
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@types/node": "^20.17.2",
"@vitest/coverage-v8": "^1.6.0",
"babel-plugin-syntax-hermes-parser": "^0.19.2",
Expand Down
Loading
Loading