Skip to content

Commit 9eb7a17

Browse files
Add update to third-party license and remove publish job in ci.yml
1 parent 2bc2eff commit 9eb7a17

File tree

2 files changed

+24
-51
lines changed

2 files changed

+24
-51
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -290,54 +290,6 @@ jobs:
290290
with:
291291
github-token: ${{ secrets.GITHUB_TOKEN }}
292292
parallel-finished: true
293-
publish:
294-
name: Publish
295-
runs-on: ubuntu-latest
296-
permissions:
297-
contents: write
298-
id-token: write
299-
needs:
300-
- lint
301-
- test
302-
- test-macOS-windows-binding
303-
- test-linux-binding
304-
steps:
305-
- uses: actions/checkout@v5
306-
- name: Setup node
307-
uses: actions/setup-node@v4
308-
with:
309-
node-version: 22
310-
cache: yarn
311-
- name: Install dependencies
312-
run: yarn install
313-
- name: create npm dirs
314-
run: yarn napi create-npm-dirs
315-
- name: Download all artifacts
316-
uses: actions/download-artifact@v5
317-
with:
318-
path: artifacts
319-
- name: Move artifacts
320-
run: yarn artifacts
321-
- name: List packages
322-
run: ls -R ./npm
323-
shell: bash
324-
- name: Publish
325-
run: |
326-
npm config set provenance true
327-
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
328-
then
329-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
330-
npm publish --access public
331-
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
332-
then
333-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
334-
npm publish --tag next --access public
335-
else
336-
echo "Not a release, skipping publish"
337-
fi
338-
env:
339-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
340-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
341293
license-and-audit:
342294
runs-on: ubuntu-latest
343295
steps:

.github/workflows/release.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ jobs:
3737
run: yarn install
3838
- name: Install conventional-changelog-cli
3939
run: npm install -g conventional-changelog-cli
40+
- name: Install cargo tools for license verification
41+
run: |
42+
cargo install --locked --version 0.8.2 cargo-about
4043
- name: Update package.json version
4144
run: |
4245
npm version ${{ github.event.inputs.version }} --no-git-tag-version
4346
- name: Update Cargo.toml version
4447
run: |
4548
sed -i 's/^version = ".*"/version = "${{ github.event.inputs.version }}"/' Cargo.toml
49+
- name: Update third-party licenses
50+
run: |
51+
cargo about generate about.hbs > LICENSE-3RD-PARTY.txt
4652
- name: Generate changelog
4753
run: |
4854
conventional-changelog -p conventionalcommits -i CHANGELOG.md -s
@@ -52,7 +58,7 @@ jobs:
5258
run: |
5359
git config --local user.email "[email protected]"
5460
git config --local user.name "GitHub Action"
55-
git add package.json Cargo.toml index.js index.d.ts CHANGELOG.md
61+
git add package.json Cargo.toml index.js index.d.ts CHANGELOG.md LICENSE-3RD-PARTY.txt
5662
git commit -m "${{ github.event.inputs.version }}"
5763
git push
5864
- name: Set version output
@@ -162,7 +168,22 @@ jobs:
162168
- name: Publish to NPM
163169
run: |
164170
npm config set provenance true
165-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
166-
npm publish --access public
171+
COMMIT_MSG=$(git log -1 --pretty=%B)
172+
if echo "$COMMIT_MSG" | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" > /dev/null;
173+
then
174+
echo "Publishing stable release to latest tag"
175+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
176+
npm publish --access public
177+
elif echo "$COMMIT_MSG" | grep -E "^[0-9]+\.[0-9]+\.[0-9]+" > /dev/null;
178+
then
179+
echo "Publishing pre-release to next tag"
180+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
181+
npm publish --tag next --access public
182+
else
183+
echo "Invalid release tag format: '$COMMIT_MSG'"
184+
echo "Expected format: X.Y.Z or X.Y.Z-suffix"
185+
echo "Skipping publish"
186+
exit 0
187+
fi
167188
env:
168189
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)