From b250213527a29eaf2a64d7ce6b1b44192e5921ed Mon Sep 17 00:00:00 2001 From: rldyourmnd Date: Fri, 4 Sep 2026 05:08:33 +0500 Subject: [PATCH] feat: recover crates packaging outside the checkout Generated by the setup-systems release publisher at 0.0.61. This repository is generated: propose changes through its public issues and pull requests. --- .github/workflows/publish-crates.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index 94b13f9..d6dd816 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -4,9 +4,15 @@ on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' + workflow_dispatch: + inputs: + tag: + description: existing release tag to backfill + required: true + type: string concurrency: - group: publish-crates-${{ github.ref }} + group: publish-crates-${{ inputs.tag || github.ref_name }} cancel-in-progress: false permissions: @@ -23,20 +29,22 @@ jobs: steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: + ref: ${{ inputs.tag || github.sha }} persist-credentials: false - name: Build the self-contained crate env: - TAG: ${{ github.ref_name }} + TAG: ${{ inputs.tag || github.ref_name }} + CRATES_OUT: ${{ runner.temp }}/crates-io 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" + python3 tools/build_crates_io.py --out "$CRATES_OUT" --harness opencode --version "$version" + cargo package --manifest-path "$CRATES_OUT/opencode-setup-system/Cargo.toml" + cargo install --path "$CRATES_OUT/opencode-setup-system" --root "$CRATES_OUT/install" --locked + "$CRATES_OUT/install/bin/opencode-setup-system" provider-info > "$CRATES_OUT/provider-info.json" + test "$(jq -r .provider_id "$CRATES_OUT/provider-info.json")" = "opencode-setup-system" - name: Mint a short-lived crates.io token id: crates @@ -45,4 +53,5 @@ jobs: - 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 + CRATES_OUT: ${{ runner.temp }}/crates-io + run: cargo publish --manifest-path "$CRATES_OUT/opencode-setup-system/Cargo.toml"