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
44 changes: 12 additions & 32 deletions .github/workflows/build-release.yaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,25 +6,17 @@ on:
- main
paths-ignore:
- ".github/**"
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:
Expand All@@ -37,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 }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

notify-failure:
needs: [release]
needs: [tag, release]
if: failure()
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/release.yaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Expand All@@ -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
Comment thread
aurimasbutkus marked this conversation as resolved.

- name: Repo checkout
uses: actions/checkout@v7
with:
Expand All@@ -27,4 +45,5 @@ jobs:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
GORELEASER_CURRENT_TAG: ${{ inputs.tag }}