@@ -34,25 +34,46 @@ jobs:
3434 VERSION="${GITHUB_REF_NAME#v}"
3535 echo "VERSION=$VERSION" >> "$GITHUB_ENV"
3636
37- # Bump crate versions
37+ # Bump crate versions. Every workspace member that harmont-cli
38+ # depends on (directly or transitively) must be published, so each
39+ # one needs the tagged version stamped in.
3840 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-util/Cargo.toml
3941 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-pipeline-ir/Cargo.toml
42+ sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-config/Cargo.toml
4043 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-plugin-protocol/Cargo.toml
44+ sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-render/Cargo.toml
45+ sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-vm/Cargo.toml
46+ sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-exec/Cargo.toml
4147 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-plugin-cloud/Cargo.toml
4248 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-dsl-engine/Cargo.toml
4349 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm/Cargo.toml
4450
4551 # Rewrite workspace.dependencies pins so dependents resolve to the
4652 # tagged version (cargo publish strips path deps; the version field
4753 # is what consumers will receive).
48- sed -i "s|hm-util = { path = \"crates/hm-util\", version = \"0.0.0-dev\" }|hm-util = { path = \"crates/hm-util\", version = \"$VERSION\" }|" Cargo.toml
49- sed -i "s|hm-pipeline-ir = { path = \"crates/hm-pipeline-ir\", version = \"0.0.0-dev\" }|hm-pipeline-ir = { path = \"crates/hm-pipeline-ir\", version = \"$VERSION\" }|" Cargo.toml
54+ sed -i "s|hm-exec = { path = \"crates/hm-exec\", version = \"0.0.0-dev\" }|hm-exec = { path = \"crates/hm-exec\", version = \"$VERSION\" }|" Cargo.toml
5055 sed -i "s|hm-plugin-protocol = { path = \"crates/hm-plugin-protocol\", version = \"0.0.0-dev\" }|hm-plugin-protocol = { path = \"crates/hm-plugin-protocol\", version = \"$VERSION\" }|" Cargo.toml
5156 sed -i "s|hm-plugin-cloud = { path = \"crates/hm-plugin-cloud\", version = \"0.0.0-dev\" }|hm-plugin-cloud = { path = \"crates/hm-plugin-cloud\", version = \"$VERSION\" }|" Cargo.toml
57+ sed -i "s|hm-pipeline-ir = { path = \"crates/hm-pipeline-ir\", version = \"0.0.0-dev\" }|hm-pipeline-ir = { path = \"crates/hm-pipeline-ir\", version = \"$VERSION\" }|" Cargo.toml
58+ sed -i "s|hm-util = { path = \"crates/hm-util\", version = \"0.0.0-dev\" }|hm-util = { path = \"crates/hm-util\", version = \"$VERSION\" }|" Cargo.toml
59+ sed -i "s|hm-config = { path = \"crates/hm-config\", version = \"0.0.0-dev\" }|hm-config = { path = \"crates/hm-config\", version = \"$VERSION\" }|" Cargo.toml
5260 sed -i "s|hm-dsl-engine = { path = \"crates/hm-dsl-engine\", version = \"0.0.0-dev\" }|hm-dsl-engine = { path = \"crates/hm-dsl-engine\", version = \"$VERSION\" }|" Cargo.toml
61+ sed -i "s|hm-render = { path = \"crates/hm-render\", version = \"0.0.0-dev\" }|hm-render = { path = \"crates/hm-render\", version = \"$VERSION\" }|" Cargo.toml
62+ sed -i "s|hm-vm = { path = \"crates/hm-vm\", version = \"0.0.0-dev\" }|hm-vm = { path = \"crates/hm-vm\", version = \"$VERSION\" }|" Cargo.toml
5363
5464 cargo check --workspace --exclude hm-fixtures
5565
66+ - name : Publishability guard (dry-run package the whole graph)
67+ # Fail fast before any real `cargo publish` if the dependency graph
68+ # isn't publishable — e.g. a publishable crate depending on a
69+ # `publish = false` crate, or a missing version bump. `cargo package
70+ # --workspace` resolves sibling path deps locally (no index lookup,
71+ # unlike `cargo publish --dry-run`, which the not-yet-published deps
72+ # would fail), so it catches exactly the publish=false / unpublished-dep
73+ # class of regression. `--no-verify` skips the per-crate rebuild;
74+ # `cargo check --workspace` above already proved it compiles.
75+ run : cargo package --workspace --exclude hm-fixtures --allow-dirty --no-verify
76+
5677 - name : Publish hm-util
5778 run : |
5879 if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-util/$VERSION" > /dev/null 2>&1; then
7596 - name : Wait for crates.io index
7697 run : sleep 30
7798
99+ - name : Publish hm-config
100+ run : |
101+ if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-config/$VERSION" > /dev/null 2>&1; then
102+ echo "hm-config@$VERSION already published, skipping"
103+ else
104+ cargo publish -p hm-config --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
105+ fi
106+
107+ - name : Wait for crates.io index
108+ run : sleep 30
109+
78110 - name : Publish hm-plugin-protocol
79111 run : |
80112 if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-plugin-protocol/$VERSION" > /dev/null 2>&1; then
@@ -86,6 +118,39 @@ jobs:
86118 - name : Wait for crates.io index
87119 run : sleep 30
88120
121+ - name : Publish hm-render
122+ run : |
123+ if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-render/$VERSION" > /dev/null 2>&1; then
124+ echo "hm-render@$VERSION already published, skipping"
125+ else
126+ cargo publish -p hm-render --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
127+ fi
128+
129+ - name : Wait for crates.io index
130+ run : sleep 30
131+
132+ - name : Publish hm-vm
133+ run : |
134+ if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-vm/$VERSION" > /dev/null 2>&1; then
135+ echo "hm-vm@$VERSION already published, skipping"
136+ else
137+ cargo publish -p hm-vm --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
138+ fi
139+
140+ - name : Wait for crates.io index
141+ run : sleep 30
142+
143+ - name : Publish hm-exec
144+ run : |
145+ if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-exec/$VERSION" > /dev/null 2>&1; then
146+ echo "hm-exec@$VERSION already published, skipping"
147+ else
148+ cargo publish -p hm-exec --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
149+ fi
150+
151+ - name : Wait for crates.io index
152+ run : sleep 30
153+
89154 - name : Publish hm-plugin-cloud
90155 run : |
91156 if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-plugin-cloud/$VERSION" > /dev/null 2>&1; then
0 commit comments