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
48 changes: 48 additions & 0 deletions .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: publish-crates

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

concurrency:
group: publish-crates-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: read

jobs:
publish:
name: package, verify and publish
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write # crates.io exchanges this OIDC identity for one short-lived publish token
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Build the self-contained crate
env:
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
version="${TAG#v}"
test "$version" = "$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)"
python3 tools/build_crates_io.py --out crates-io --harness opencode --version "$version"
cargo package --manifest-path crates-io/opencode-setup-system/Cargo.toml
cargo install --path crates-io/opencode-setup-system --root crates-io/install --locked
crates-io/install/bin/opencode-setup-system provider-info > crates-io/provider-info.json
test "$(jq -r .provider_id crates-io/provider-info.json)" = "opencode-setup-system"

- name: Mint a short-lived crates.io token
id: crates
uses: rust-lang/crates-io-auth-action@82864bf380abd3e242c564a5ba58dd29d6265b00

- name: Publish opencode-setup-system
env:
CARGO_REGISTRY_TOKEN: ${{ steps.crates.outputs.token }}
run: cargo publish --manifest-path crates-io/opencode-setup-system/Cargo.toml
2 changes: 1 addition & 1 deletion crates/harness-runtime/src/facts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub struct Foreign {
pub const BACKUP_SLOTS: usize = 10;

/// The bundle format every setup system reads.
pub const BUNDLE_FORMAT: &str = "ai-stp-bundle/1";
pub const BUNDLE_FORMAT: &str = "ai-stp-bundle/2";

impl Harness {
/// Whether one relative path falls inside a namespace this harness claims.
Expand Down
Loading
Loading