diff --git a/.github/workflows/dispatch-publish-release.yml b/.github/workflows/dispatch-publish-release.yml new file mode 100644 index 0000000..b41cb33 --- /dev/null +++ b/.github/workflows/dispatch-publish-release.yml @@ -0,0 +1,25 @@ +--- +name: Dispatch Publish Release +permissions: + actions: write + contents: read + +on: + push: + tags: + - "v*" + +jobs: + dispatch: + if: github.repository == 'openai/openai-cli' + runs-on: ubuntu-latest + steps: + - name: Dispatch Publish Release on main + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ github.ref_name }} + run: | + gh workflow run publish-release.yml \ + --repo "$GITHUB_REPOSITORY" \ + --ref main \ + -f tag="$TAG" diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 8dba2a1..1fca827 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,12 +7,15 @@ concurrency: group: publish on: - push: - tags: - - "v*" - workflow_dispatch: {} + workflow_dispatch: + inputs: + tag: + description: "Release tag to publish, for example v1.2.3" + required: true + type: string jobs: goreleaser: + if: github.repository == 'openai/openai-cli' runs-on: ubuntu-latest environment: publish permissions: @@ -25,6 +28,31 @@ jobs: with: fetch-depth: 0 persist-credentials: false + - name: Ensure release tag is on main + env: + TAG: ${{ inputs.tag }} + run: | + case "$TAG" in + v*) ;; + *) echo "Release tag must start with v: $TAG"; exit 1 ;; + esac + git check-ref-format "refs/tags/$TAG" + + remote_tag="$(git ls-remote --exit-code --tags --refs origin "refs/tags/$TAG")" + remote_ref="$(printf '%s\n' "$remote_tag" | awk '{print $2}')" + test "$remote_ref" = "refs/tags/$TAG" + + git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main + git fetch --no-tags origin "+refs/tags/$TAG:refs/tags/$TAG" + + local_ref="$(git for-each-ref --format='%(refname)' "refs/tags/$TAG")" + test "$local_ref" = "refs/tags/$TAG" + + tag_sha="$(git rev-parse "refs/tags/$TAG^{commit}")" + echo "Release tag $TAG resolves to $tag_sha" + git merge-base --is-ancestor "$tag_sha" origin/main + git checkout --detach "$tag_sha" + test "$(git rev-parse HEAD)" = "$tag_sha" - name: Set up Go uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: @@ -57,6 +85,7 @@ jobs: env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.tap-token.outputs.token }} + GORELEASER_CURRENT_TAG: ${{ inputs.tag }} MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }} MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }} MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2601677..b55c11f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.1.0" + ".": "1.1.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 29d4347..d5e6777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.1.1 (2026-05-07) + +Full Changelog: [v1.1.0...v1.1.1](https://github.com/openai/openai-cli/compare/v1.1.0...v1.1.1) + ## 1.1.0 (2026-05-07) Full Changelog: [v1.0.0...v1.1.0](https://github.com/openai/openai-cli/compare/v1.0.0...v1.1.0) diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index a47345e..ef6b949 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "1.1.0" // x-release-please-version +const Version = "1.1.1" // x-release-please-version