Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: fmt · clippy · test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
Expand All @@ -34,7 +34,7 @@ jobs:
name: wasm build + pack
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
Expand Down
31 changes: 8 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: verify tag matches crate version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Check version
run: |
crate="$(cargo metadata --no-deps --format-version 1 \
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
Expand All @@ -74,25 +74,10 @@ jobs:
if: ${{ vars.PUBLISH_CRATES == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- name: Publish okftool-core
run: cargo publish -p okftool-core
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Wait for okftool-core index propagation
run: |
version="${GITHUB_REF_NAME#v}"
for i in {1..20}; do
if cargo search okftool-core --limit 1 | grep -q "^okftool-core = \"$version\""; then
exit 0
fi
sleep 15
done
echo "::error::okftool-core $version did not appear in the crates.io index" >&2
exit 1
- name: Publish okftool-cli
run: cargo publish -p okftool-cli
- name: Publish crates
run: scripts/publish-crates.sh
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Expand All @@ -102,7 +87,7 @@ jobs:
needs: [guard, binaries]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Package docs/okf and upload to the release
Expand All @@ -120,14 +105,14 @@ jobs:
if: ${{ vars.PUBLISH_NPM == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: jetli/wasm-pack-action@v0.4.0
- name: Build npm package
run: scripts/build-npm-package.sh
- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.2] - 2026-06-25

### Fixed

- Made crates.io publishing retry-safe after partial release success and switched
crates.io propagation checks to exact `cargo info crate@version` lookups.
- Updated GitHub Actions workflow action versions to Node 24-compatible majors.

## [0.2.1] - 2026-06-25

### Fixed
Expand Down Expand Up @@ -70,7 +78,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Self-documenting OKF bundle at `docs/okf/`, linted under the strict profile in
CI (dogfood).

[Unreleased]: https://github.com/ryansann/okftool/compare/v0.2.1...HEAD
[Unreleased]: https://github.com/ryansann/okftool/compare/v0.2.2...HEAD
[0.2.2]: https://github.com/ryansann/okftool/compare/v0.2.1...v0.2.2
[0.2.1]: https://github.com/ryansann/okftool/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/ryansann/okftool/compare/v0.1.5...v0.2.0
[0.1.5]: https://github.com/ryansann/okftool/compare/v0.1.4...v0.1.5
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/okftool-core", "crates/okftool-cli", "crates/okftool-wasm"]

[workspace.package]
version = "0.2.1"
version = "0.2.2"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/ryansann/okftool"
Expand Down
2 changes: 1 addition & 1 deletion crates/okftool-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name = "okftool"
path = "src/main.rs"

[dependencies]
okftool-core = { path = "../okftool-core", version = "0.2.1" }
okftool-core = { path = "../okftool-core", version = "0.2.2" }
serde_json = { workspace = true }
clap = { version = "4", features = ["derive"] }
tar = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion crates/okftool-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ publish = false
crate-type = ["cdylib", "rlib"]

[dependencies]
okftool-core = { path = "../okftool-core", version = "0.2.1" }
okftool-core = { path = "../okftool-core", version = "0.2.2" }
serde = { workspace = true }
serde_json = { workspace = true }
wasm-bindgen = "0.2"
Expand Down
59 changes: 59 additions & 0 deletions scripts/publish-crates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash
set -euo pipefail

version="${GITHUB_REF_NAME#v}"
if [[ -z "${version}" || "${version}" == "${GITHUB_REF_NAME}" ]]; then
version="$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[] | select(.name=="okftool-cli") | .version')"
fi

crate_published() {
local crate="$1"
cargo info "${crate}@${version}" --quiet >/dev/null 2>&1
}

publish_or_skip() {
local package="$1"
local crate="$2"
local log
log="$(mktemp)"

if crate_published "${crate}"; then
echo "${crate}@${version} is already published; skipping"
return 0
fi

echo "Publishing ${crate}@${version}"
if cargo publish -p "${package}" 2>&1 | tee "${log}"; then
return 0
fi

if grep -q "already exists on crates.io index" "${log}"; then
echo "${crate}@${version} is already published; treating as success"
return 0
fi

return 1
}

wait_for_crate() {
local crate="$1"
local attempts="${2:-80}"
local sleep_seconds="${3:-15}"

for ((i = 1; i <= attempts; i++)); do
if crate_published "${crate}"; then
echo "${crate}@${version} is visible in the crates.io index"
return 0
fi
echo "Waiting for ${crate}@${version} in the crates.io index (${i}/${attempts})"
sleep "${sleep_seconds}"
done

echo "::error::${crate} ${version} did not appear in the crates.io index" >&2
return 1
}

publish_or_skip okftool-core okftool-core
wait_for_crate okftool-core
publish_or_skip okftool-cli okftool-cli
Loading