Skip to content

Commit 4e0ecf7

Browse files
committed
Add fss package publish workflow
1 parent 3608c62 commit 4e0ecf7

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/publish-ui.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [main]
66
paths:
7+
- "packages/fss/**"
78
- "packages/ui/**"
89
- "packages/extension-api/**"
910
- "pnpm-lock.yaml"
@@ -14,8 +15,60 @@ permissions:
1415
contents: read
1516

1617
jobs:
18+
publish-fss:
19+
runs-on: self-hosted
20+
steps:
21+
- uses: actions/checkout@v6
22+
23+
- uses: pnpm/action-setup@v5
24+
25+
- uses: actions/setup-node@v6
26+
with:
27+
node-version: 24
28+
cache: pnpm
29+
registry-url: https://registry.npmjs.org
30+
env:
31+
NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm-cache
32+
33+
- run: pnpm install --frozen-lockfile
34+
env:
35+
NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm-cache
36+
37+
- name: Check npm version
38+
id: version_check
39+
shell: bash
40+
env:
41+
NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm-cache
42+
run: |
43+
PACKAGE_NAME=$(node -p "require('./packages/fss/package.json').name")
44+
PACKAGE_VERSION=$(node -p "require('./packages/fss/package.json').version")
45+
PUBLISHED_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || true)
46+
47+
echo "package_name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT"
48+
echo "package_version=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT"
49+
50+
if [ "$PUBLISHED_VERSION" = "$PACKAGE_VERSION" ]; then
51+
echo "should_publish=false" >> "$GITHUB_OUTPUT"
52+
echo "Version $PACKAGE_VERSION is already published for $PACKAGE_NAME."
53+
else
54+
echo "should_publish=true" >> "$GITHUB_OUTPUT"
55+
if [ -n "$PUBLISHED_VERSION" ]; then
56+
echo "Publishing $PACKAGE_NAME@$PACKAGE_VERSION over current npm version $PUBLISHED_VERSION."
57+
else
58+
echo "Publishing first npm release for $PACKAGE_NAME@$PACKAGE_VERSION."
59+
fi
60+
fi
61+
62+
- name: Publish fss package
63+
if: steps.version_check.outputs.should_publish == 'true'
64+
run: pnpm publish --access public --no-git-checks
65+
working-directory: packages/fss
66+
env:
67+
NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm-cache
68+
1769
publish-extension-api:
1870
runs-on: self-hosted
71+
needs: publish-fss
1972
steps:
2073
- uses: actions/checkout@v6
2174

0 commit comments

Comments
 (0)