Skip to content

Commit ffcb2bf

Browse files
authored
chore(cli): set binding version in release workflow (#263)
### TL;DR Fix version handling in the release workflow to ensure consistent versioning across Rust and npm packages. ### What changed? - Added a new step in the release workflow to set the binding version using the commit SHA - Renamed the existing version step to "Set npm packages version" for clarity - Updated the version in `packages/cli/binding/Cargo.toml` from "0.0.1" to "0.0.0" to match the npm versioning pattern - Corresponding update in `Cargo.lock` to reflect the version change ### How to test? 1. Trigger the release workflow 2. Verify that both the Rust binding and npm packages have the same version format (`0.0.0-{commit-sha}`) 3. Check that the artifacts are properly versioned in the release ### Why make this change? This change ensures version consistency between the Rust bindings and npm packages during the release process. By using the same version pattern across all components, we avoid potential compatibility issues and make it easier to track which versions belong together.
1 parent a74a40b commit ffcb2bf

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747

4848
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
4949

50+
- name: Set binding version
51+
run: |
52+
sed -i 's/version = "0.0.0"/version = "0.0.0-${{ github.sha }}"/' packages/cli/binding/Cargo.toml
53+
5054
- name: Build
5155
if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }}
5256
run: pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }} --use-napi-cross
@@ -108,7 +112,7 @@ jobs:
108112
pattern: bindings-*
109113
merge-multiple: true
110114

111-
- name: Set version
115+
- name: Set npm packages version
112116
run: |
113117
sed -i 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/global/package.json
114118
sed -i 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/cli/package.json

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/binding/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vite-plus-cli"
3-
version = "0.0.1"
3+
version = "0.0.0"
44
edition = "2024"
55

66
[[bin]]

0 commit comments

Comments
 (0)