From dbfac2ed3567fe8bae09b9543915936824d88233 Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Thu, 7 May 2026 14:19:05 -0400 Subject: [PATCH 1/3] Guard release tags against non-main commits --- .github/workflows/publish-release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 8dba2a1..8f97c01 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -25,6 +25,11 @@ jobs: with: fetch-depth: 0 persist-credentials: false + - name: Ensure release tag is on main + if: startsWith(github.ref, 'refs/tags/') + run: | + git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main + git merge-base --is-ancestor "$GITHUB_SHA" origin/main - name: Set up Go uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: From dc3073dd16ed99ce44b3741ccd6f0bbf2b4b8226 Mon Sep 17 00:00:00 2001 From: Alex Chang Date: Thu, 7 May 2026 15:11:05 -0400 Subject: [PATCH 2/3] Run release publish from main workflow (#217) --- .../workflows/dispatch-publish-release.yml | 25 +++++++++++++ .github/workflows/publish-release.yml | 36 +++++++++++++++---- 2 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/dispatch-publish-release.yml 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 8f97c01..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: @@ -26,10 +29,30 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Ensure release tag is on main - if: startsWith(github.ref, 'refs/tags/') + 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 merge-base --is-ancestor "$GITHUB_SHA" 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: @@ -62,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 }} From 281a2bdf8f26ef7e82b0d9b68f221ec3815dc7e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 19:11:39 +0000 Subject: [PATCH 3/3] release: 1.1.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 4 ++++ pkg/cmd/version.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) 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