Skip to content
Open
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
30 changes: 26 additions & 4 deletions .github/workflows/release-main-and-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ jobs:
contents: write

steps:
- name: Checkout main
- name: Checkout release branch
uses: actions/checkout@v6
with:
ref: main
ref: release/v${{ needs.prepare-main.outputs.version }}
fetch-depth: 0

- uses: actions/setup-node@v6
Expand All @@ -390,6 +390,17 @@ jobs:
- run: npm ci
- run: npm run build

- name: Verify version before publish
env:
EXPECTED: ${{ needs.prepare-main.outputs.version }}
run: |
ACTUAL=$(node -p "require('./package.json').version")
if [ "$ACTUAL" != "$EXPECTED" ]; then
echo "❌ Version mismatch: expected $EXPECTED, got $ACTUAL"
exit 1
fi
echo "✅ Publishing version $ACTUAL"

- name: Publish to npm
run: npm publish --access public --provenance --tag latest

Expand Down Expand Up @@ -431,10 +442,10 @@ jobs:
contents: write

steps:
- name: Checkout preview
- name: Checkout release branch
uses: actions/checkout@v6
with:
ref: preview
ref: release/v${{ needs.prepare-preview.outputs.version }}
fetch-depth: 0

- uses: actions/setup-node@v6
Expand All @@ -446,6 +457,17 @@ jobs:
- run: npm ci
- run: npm run build

- name: Verify version before publish
env:
EXPECTED: ${{ needs.prepare-preview.outputs.version }}
run: |
ACTUAL=$(node -p "require('./package.json').version")
if [ "$ACTUAL" != "$EXPECTED" ]; then
echo "❌ Version mismatch: expected $EXPECTED, got $ACTUAL"
exit 1
fi
echo "✅ Publishing version $ACTUAL"

- name: Publish to npm
run: npm publish --access public --provenance --tag preview

Expand Down
Loading