Skip to content

Commit 3f6efbb

Browse files
authored
Add publish workflow (#779)
1 parent 4eced53 commit 3f6efbb

File tree

4 files changed

+72
-5
lines changed

4 files changed

+72
-5
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
validate:
14+
name: Validate
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: CI Setup
21+
uses: ./.github/actions/ci-setup
22+
23+
- name: Lint
24+
run: pnpm --filter "@radix-ui/*" lint
25+
26+
- name: Build packages
27+
run: pnpm --filter "@radix-ui/*" build

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
env:
8+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
publish:
16+
name: Publish Package
17+
if: github.repository == 'radix-ui/themes'
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
id-token: write
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: CI Setup
27+
uses: ./.github/actions/ci-setup
28+
29+
- name: Setup npm registry
30+
uses: actions/setup-node@v4
31+
with:
32+
registry-url: 'https://registry.npmjs.org'
33+
34+
- name: Lint
35+
run: pnpm --filter "@radix-ui/*" lint
36+
37+
- name: Build packages
38+
run: pnpm --filter "@radix-ui/*" build
39+
40+
- name: Publish packages
41+
run: pnpm --filter "@radix-ui/*" publish --access public --provenance --no-git-checks

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"packageManager": "pnpm@10.0.0",
55
"scripts": {
66
"build": "turbo run build",
7-
"build:pkg": "pnpm --filter @radix-ui/themes build",
7+
"build:pkg": "pnpm --filter \"@radix-ui/*\" build",
88
"dev": "turbo run dev --no-cache --continue",
99
"lint": "turbo run lint",
1010
"clean": "turbo run clean && rm -rf node_modules .turbo",

packages/radix-ui-themes/src/components/theme-panel.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ const ThemePanelImpl = React.forwardRef<ThemePanelImplElement, ThemePanelImplPro
6464
onScalingChange,
6565
} = themeContext;
6666

67+
const [resolvedAppearance, setResolvedAppearance] = React.useState<'light' | 'dark' | null>(
68+
appearance === 'inherit' ? null : appearance,
69+
);
6770
const hasOnAppearanceChangeProp = onAppearanceChangeProp !== undefined;
6871
const handleAppearanceChangeProp = useCallbackRef(onAppearanceChangeProp);
6972
const handleAppearanceChange = React.useCallback(
@@ -115,10 +118,6 @@ const ThemePanelImpl = React.forwardRef<ThemePanelImplElement, ThemePanelImplPro
115118
setTimeout(() => setCopyState('idle'), 2000);
116119
}
117120

118-
const [resolvedAppearance, setResolvedAppearance] = React.useState<'light' | 'dark' | null>(
119-
appearance === 'inherit' ? null : appearance,
120-
);
121-
122121
const keyboardInputElement = `
123122
[contenteditable],
124123
[role="combobox"],

0 commit comments

Comments
 (0)