Skip to content

Commit 6d293d3

Browse files
committed
ci: split CI and release workflows
- CI.yml: lint + build + test on push/PR (no publish) - release.yml: triggered by GitHub release, builds all platforms, publishes to npm + crates.io - Uses release tag to determine npm dist-tag (stable vs next)
1 parent a0320ac commit 6d293d3

23 files changed

Lines changed: 612 additions & 555 deletions

File tree

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ env:
44
APP_NAME: "domparser-rs"
55
MACOSX_DEPLOYMENT_TARGET: "10.13"
66
permissions:
7-
contents: write
8-
id-token: write
7+
contents: read
98
"on":
109
push:
1110
branches:
@@ -334,50 +333,4 @@ jobs:
334333
-v ${{ github.workspace }}:/build \
335334
-w /build \
336335
node:lts-alpine \
337-
/bin/sh -c "set -e && yarn test"
338-
publish:
339-
name: Publish
340-
runs-on: ubuntu-latest
341-
needs:
342-
- test-macOS-windows-binding
343-
- test-linux-x64-gnu-binding
344-
- test-linux-x64-musl-binding
345-
- test-linux-aarch64-gnu-binding
346-
- test-linux-aarch64-musl-binding
347-
steps:
348-
- uses: actions/checkout@v4
349-
- name: Setup node
350-
uses: actions/setup-node@v4
351-
with:
352-
node-version: 20
353-
cache: yarn
354-
- name: Install dependencies
355-
run: yarn install
356-
- name: Download all artifacts
357-
uses: actions/download-artifact@v4
358-
with:
359-
path: artifacts
360-
- name: Move artifacts
361-
run: yarn artifacts
362-
- name: List packages
363-
run: ls -R ./npm
364-
shell: bash
365-
- name: Publish
366-
run: |
367-
npm config set provenance true
368-
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
369-
then
370-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
371-
npm publish --access public --provenance
372-
cargo publish -p domparser --token $CARGO_REGISTRY_TOKEN
373-
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
374-
then
375-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
376-
npm publish --tag next --access public --provenance
377-
else
378-
echo "Not a release, skipping publish"
379-
fi
380-
env:
381-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
382-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
383-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
336+
/bin/sh -c "set -e && yarn test"

0 commit comments

Comments
 (0)