Skip to content

Commit

Permalink
build: combine rust release workflows (#611)
Browse files Browse the repository at this point in the history
Okay, phew.

The main bug from the [last
PR](#610) was that the rust
releases scramble to publish, but we have to publish them in a
particular order for the release to work since they depend on each
other.

There's a secondary bug: `cargo publish` is prone to 502'ing on publish.
I lean towards seeing how painful this is in practice; we should be able
to safely re-run the release flow on failure.
  • Loading branch information
chrisdickinson authored Dec 1, 2023
1 parent 75f2ea2 commit 528ae6f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 87 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/release-convert.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/release-manifest.yaml

This file was deleted.

32 changes: 31 additions & 1 deletion .github/workflows/release-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,38 @@ jobs:
override: true
target: ${{ matrix.target }}

- name: Release Rust Convert Crate
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }}
run: |
version=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "extism") | .version')
if ! &>/dev/null curl -sLIf https://crates.io/api/v1/crates/extism-convert/${version}/download; then
cargo publish --manifest-path convert/Cargo.toml --allow-dirty
else
echo "already published ${version}"
fi
- name: Release Rust Manifest Crate
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }}
run: |
version=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "extism") | .version')
if ! &>/dev/null curl -sLIf https://crates.io/api/v1/crates/extism-manifest/${version}/download; then
cargo publish --manifest-path manifest/Cargo.toml --allow-dirty
else
echo "already published ${version}"
fi
- name: Release Runtime
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }}
run: |
cargo publish --manifest-path runtime/Cargo.toml --allow-dirty
version=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "extism") | .version')
if ! &>/dev/null curl -sLIf https://crates.io/api/v1/crates/extism/${version}/download; then
cargo publish --manifest-path runtime/Cargo.toml --allow-dirty
else
echo "already published ${version}"
fi

0 comments on commit 528ae6f

Please sign in to comment.