Skip to content

Commit 6d7f356

Browse files
authored
ci: fix crates version issue (#175)
1 parent 98edabb commit 6d7f356

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,42 @@ jobs:
9494
git push origin "v${VERSION}"
9595
fi
9696
97-
publish-encoderfile:
97+
publish-encoderfile-core:
9898
needs: create-tag
9999
runs-on: ubuntu-24.04
100100
steps:
101101
- uses: actions/checkout@v4
102102

103+
- name: Project setup
104+
uses: ./.github/actions/project-setup
105+
106+
- name: Publish encoderfile-core (dry-run)
107+
run: cargo publish -p encoderfile-core --dry-run
108+
109+
- name: Publish encoderfile-core
110+
env:
111+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
112+
run: cargo publish -p encoderfile-core
113+
114+
- name: Wait for crates.io index
115+
run: sleep 30
116+
117+
publish-encoderfile:
118+
needs: publish-encoderfile-core
119+
runs-on: ubuntu-24.04
120+
steps:
121+
- uses: actions/checkout@v4
122+
103123
- name: Project setup
104124
uses: ./.github/actions/project-setup
105125

106126
- name: Cargo publish (dry-run)
107-
run: cargo publish --dry-run
127+
run: cargo publish -p encoderfile --dry-run
108128
env:
109129
ENCODERFILE_DEV: "false"
110130

111131
- name: Cargo publish
112-
run: cargo publish
132+
run: cargo publish -p encoderfile
113133
env:
114134
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
115135
ENCODERFILE_DEV: "false"

encoderfile/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ workspace = true
4343

4444
[dependencies.encoderfile-core]
4545
path = "../encoderfile-core"
46+
version = "0.2.0"
4647
features = [ "transforms",]
4748
default-features = false
4849

scripts/bump_version.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ def write_version(path: Path, version: Version):
139139

140140
data["package"]["version"] = str(version)
141141

142+
# ALSO bump encoderfile-core dependency if it exists
143+
deps = data.get("dependencies", {})
144+
145+
core = deps.get("encoderfile-core")
146+
if isinstance(core, dict):
147+
# structured dependency
148+
core["version"] = str(version)
149+
elif isinstance(core, str):
150+
# simple string form like: encoderfile-core = "0.1.2"
151+
deps["encoderfile-core"] = str(version)
152+
# if it's missing, nothing to do.
153+
142154
with open(path, "w") as f:
143155
toml.dump(data, f)
144156

0 commit comments

Comments
 (0)