From f6c9417ef9668f13b6b1270c79a967439bf9faa0 Mon Sep 17 00:00:00 2001 From: Aurimas Butkus Date: Mon, 10 Aug 2026 10:41:48 +0300 Subject: [PATCH 1/2] fix: allow build-release to be dispatched manually --- .github/workflows/build-release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index b7c508f..f7ac689 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -6,6 +6,9 @@ on: - main paths-ignore: - ".github/**" + # Escape hatch for when a release needs cutting without a content push, e.g. + # after a failed run leaves a tag behind with no release. + workflow_dispatch: permissions: contents: write From c6fc6df323e4789da5bdeeedd239e0d9fb09c997 Mon Sep 17 00:00:00 2001 From: Aurimas Butkus Date: Mon, 10 Aug 2026 10:48:49 +0300 Subject: [PATCH 2/2] fix: make the release publishable on demand through one shared workflow --- .github/workflows/build-release.yaml | 45 +++++++--------------------- .github/workflows/release.yaml | 21 ++++++++++++- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index f7ac689..30d6daf 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -6,28 +6,17 @@ on: - main paths-ignore: - ".github/**" - # Escape hatch for when a release needs cutting without a content push, e.g. - # after a failed run leaves a tag behind with no release. workflow_dispatch: permissions: contents: write jobs: - release: + tag: runs-on: ubuntu-latest + outputs: + new_tag: ${{ steps.bump.outputs.new_tag }} steps: - - name: Get GitHub token - uses: actions/create-github-app-token@v3 - id: get_token - with: - app-id: ${{ secrets.HOSTINGERBOT_APP_ID }} - private-key: ${{ secrets.HOSTINGERBOT_PRIVATE_KEY }} - owner: hostinger - repositories: | - api-cli - homebrew-tap - - name: Repo checkout uses: actions/checkout@v7 with: @@ -40,28 +29,16 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} release_branches: main - - name: Fetch tags - if: steps.bump.outputs.new_tag != '' - run: git fetch --force --tags - - - name: Install Go - uses: actions/setup-go@v7 - with: - go-version-file: 'go.mod' - - - name: Run GoReleaser - if: steps.bump.outputs.new_tag != '' - uses: goreleaser/goreleaser-action@v7 - with: - distribution: goreleaser - version: "~> v2" - args: release --clean - env: - GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} - GORELEASER_CURRENT_TAG: ${{ steps.bump.outputs.new_tag }} + release: + needs: tag + if: needs.tag.outputs.new_tag != '' + uses: ./.github/workflows/release.yaml + secrets: inherit + with: + tag: ${{ needs.tag.outputs.new_tag }} notify-failure: - needs: [release] + needs: [tag, release] if: failure() runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2ec04ce..214b27e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,13 @@ name: release on: workflow_dispatch: + workflow_call: + inputs: + tag: + description: 'Tag to publish; defaults to the tag on the checked-out commit' + required: false + type: string + default: '' permissions: contents: write @@ -10,6 +17,17 @@ jobs: release: runs-on: ubuntu-latest steps: + - name: Get GitHub token + uses: actions/create-github-app-token@v3 + id: get_token + with: + app-id: ${{ secrets.HOSTINGERBOT_APP_ID }} + private-key: ${{ secrets.HOSTINGERBOT_PRIVATE_KEY }} + owner: hostinger + repositories: | + api-cli + homebrew-tap + - name: Repo checkout uses: actions/checkout@v7 with: @@ -27,4 +45,5 @@ jobs: version: "~> v2" args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} + GORELEASER_CURRENT_TAG: ${{ inputs.tag }}