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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ jobs:
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2

- name: Package publishable crates
- name: Test selective release tooling
run: python3 -B -m unittest discover -s scripts -p 'test_publish_crates.py'

- name: Package crates in the release plan
run: scripts/publish-crates.sh --dry-run

gate:
Expand Down
65 changes: 17 additions & 48 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ on:
workflow_dispatch:
inputs:
version:
description: Workspace version to publish
description: Release identifier in release.json
required: true
default: "0.1.2"
type: string
dry_run:
description: Run package preflight instead of publishing
required: true
type: boolean
default: true
start_at:
description: Optional crate name to resume from in publish order
required: false
default: ""

concurrency:
group: publish-crates-${{ github.ref }}
Expand All @@ -32,7 +28,7 @@ permissions:

jobs:
publish:
name: Publish crates.io workspace
name: Publish selected crates to crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -50,7 +46,6 @@ jobs:
EVENT_NAME: ${{ github.event_name }}
MANUAL_VERSION: ${{ inputs.version }}
MANUAL_DRY_RUN: ${{ inputs.dry_run }}
MANUAL_START_AT: ${{ inputs.start_at }}
run: |
set -euo pipefail

Expand All @@ -61,63 +56,37 @@ jobs:
fi

version="${GITHUB_REF#refs/tags/v}"
if [[ ! "$version" =~ ^[0-9]+[.][0-9]+[.][0-9]+([-+][0-9A-Za-z.-]+)?$ ]]; then
echo "release tag must be v<semver>; got ${GITHUB_REF}" >&2
exit 1
fi

dry_run=false
start_at=""
else
version="$MANUAL_VERSION"
dry_run="${MANUAL_DRY_RUN:-true}"
start_at="$MANUAL_START_AT"
fi

if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([+-][0-9A-Za-z.+-]+)?$ ]]; then
echo "invalid release version: ${version}" >&2
exit 1
fi
if [[ "$dry_run" != "true" && "$GITHUB_REF" != "refs/tags/v${version}" ]]; then
echo "publishing requires the matching v${version} tag" >&2
exit 1
fi

{
echo "version=${version}"
echo "dry_run=${dry_run}"
echo "start_at=${start_at}"
} >> "$GITHUB_OUTPUT"

- name: Verify release inputs
env:
INPUT_VERSION: ${{ steps.release-inputs.outputs.version }}
DRY_RUN: ${{ steps.release-inputs.outputs.dry_run }}
START_AT: ${{ steps.release-inputs.outputs.start_at }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
set -euo pipefail
workspace_version="$(cargo pkgid -p openwire-core | sed 's/.*#//')"
test "$workspace_version" = "$INPUT_VERSION"

if [[ "$DRY_RUN" != "true" ]]; then
test -n "${CARGO_REGISTRY_TOKEN:-}"
if [[ "${GITHUB_REF}" != "refs/tags/v${INPUT_VERSION}" ]]; then
test -n "$START_AT"
test "${GITHUB_REF}" = "refs/heads/main"
fi
fi

- name: Package preflight
if: ${{ steps.release-inputs.outputs.dry_run == 'true' }}
env:
START_AT: ${{ steps.release-inputs.outputs.start_at }}
run: |
if [[ -n "$START_AT" ]]; then
scripts/publish-crates.sh --dry-run --start-at "$START_AT"
else
scripts/publish-crates.sh --dry-run
fi
RELEASE_VERSION: ${{ steps.release-inputs.outputs.version }}
run: scripts/publish-crates.sh --dry-run --release "$RELEASE_VERSION"

- name: Publish crates
if: ${{ steps.release-inputs.outputs.dry_run != 'true' }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
START_AT: ${{ steps.release-inputs.outputs.start_at }}
RELEASE_VERSION: ${{ steps.release-inputs.outputs.version }}
run: |
if [[ -n "$START_AT" ]]; then
scripts/publish-crates.sh --publish --start-at "$START_AT"
else
scripts/publish-crates.sh --publish
fi
test -n "$CARGO_REGISTRY_TOKEN"
scripts/publish-crates.sh --publish --release "$RELEASE_VERSION"
8 changes: 4 additions & 4 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 @@ -14,7 +14,6 @@ resolver = "2"
[workspace.package]
edition = "2021"
license = "MIT"
version = "0.1.2"
authors = ["OpenWire contributors"]
repository = "https://github.com/peterich-rs/openwire"
rust-version = "1.80"
Expand All @@ -38,6 +37,7 @@ http-body = "1.0.1"
http-body-util = "0.1.3"
httpdate = "1.0.3"
hyper = { version = "1.8.1", default-features = false, features = ["client", "http1", "http2"] }
# Shared dependency minima. Members that use newer APIs declare higher minima.
openwire = { path = "crates/openwire", version = "0.1.2", default-features = false }
openwire-cache = { path = "crates/openwire-cache", version = "0.1.2" }
openwire-core = { path = "crates/openwire-core", version = "0.1.2" }
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ keeps the client API and higher-level policy / planning surfaces.

## Installation

The next planned crates.io release is `0.1.2`:
Install the OpenWire client from crates.io:

```toml
[dependencies]
openwire = "0.1.2"
openwire = "0.1.3"
```

Default features are `tls-rustls`, `platform-verifier`, `compression` (all
Expand All @@ -94,7 +94,7 @@ own default feature set through Cargo unification.

```toml
[dependencies]
openwire = { version = "0.1.2", default-features = false, features = ["tls-rustls", "gzip"] }
openwire = { version = "0.1.3", default-features = false, features = ["tls-rustls", "gzip"] }
```

Optional features:
Expand All @@ -110,8 +110,8 @@ Optional features:
| `websocket` | no | RFC 6455 WebSocket client |
| `multipart` | no | `multipart/form-data` encoder (`Form` / `Part`) |

Optional companion crates are published with the same workspace version, for
example `openwire-cache = "0.1.2"` or `openwire-tungstenite = "0.1.2"`.
Companion crates have independent versions. This release uses
`openwire-cache = "0.1.3"` and `openwire-tungstenite = "0.1.2"`.
Release and versioning steps are documented in `docs/release-process.md`.

## Quick Start
Expand Down
6 changes: 3 additions & 3 deletions crates/openwire-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire-cache"
description = "Application-layer HTTP cache interceptor for OpenWire"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.3"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand All @@ -16,13 +16,13 @@ async-trait.workspace = true
bytes.workspace = true
http.workspace = true
httpdate.workspace = true
openwire.workspace = true
openwire = { path = "../openwire", version = "0.1.3", default-features = false }
tokio = { workspace = true, features = ["sync"] }
url.workspace = true

[dev-dependencies]
hyper.workspace = true
openwire = { workspace = true, default-features = true }
openwire = { path = "../openwire", version = "0.1.3" }
openwire-rustls.workspace = true
openwire-test.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "sync", "net", "time", "io-util"] }
2 changes: 1 addition & 1 deletion crates/openwire-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire-core"
description = "Shared primitives, policies, bodies, and transport traits for OpenWire"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.3"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/openwire-fastwebsockets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire-fastwebsockets"
description = "fastwebsockets engine adapter for OpenWire WebSocket clients"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.2"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/openwire-rustls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire-rustls"
description = "Rustls TLS connector integration for OpenWire"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.2"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/openwire-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire-test"
description = "Local test support utilities for the OpenWire workspace"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.2"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/openwire-tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire-tokio"
description = "Tokio executor, timer, DNS, TCP, and I/O adapters for OpenWire"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.3"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/openwire-tungstenite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire-tungstenite"
description = "tokio-tungstenite engine adapter for OpenWire WebSocket clients"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.2"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions crates/openwire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "openwire"
description = "OkHttp-inspired async HTTP client for Rust built on hyper and tower"
edition.workspace = true
license.workspace = true
version.workspace = true
version = "0.1.3"
authors.workspace = true
repository.workspace = true
rust-version.workspace = true
Expand Down Expand Up @@ -48,8 +48,8 @@ http-body.workspace = true
http-body-util.workspace = true
httpdate.workspace = true
hyper.workspace = true
openwire-core.workspace = true
openwire-tokio.workspace = true
openwire-core = { path = "../openwire-core", version = "0.1.3" }
openwire-tokio = { path = "../openwire-tokio", version = "0.1.3" }
getrandom = { workspace = true, optional = true }
mime = { version = "0.3", default-features = false, optional = true }
openwire-rustls = { workspace = true, optional = true }
Expand Down
Loading
Loading