Skip to content

feat: regenerate CLI from OpenAPI spec #70

feat: regenerate CLI from OpenAPI spec

feat: regenerate CLI from OpenAPI spec #70

name: build-release
on:
push:
branches:
- main
paths-ignore:
- ".github/**"
permissions:
contents: write
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:
fetch-depth: 0
- name: Bump version and push tag
id: bump
uses: mathieudutour/github-tag-action@v6.2
with:
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: 1.24.x
- 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 }}
notify-failure:
needs: [release]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack on release failure
uses: slackapi/slack-github-action@v4.0.0
with:
errors: true
webhook: ${{ secrets.PLATFORM_INCIDENT_SLACK_CHANNEL_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
text: ":rotating_light: Release failed in ${{ github.repository }}"
blocks:
- type: section
text:
type: mrkdwn
text: |
:rotating_light: *Release failed:* `${{ github.repository }}`
*Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>
- type: actions
elements:
- type: button
text:
type: plain_text
text: "View failed run"
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"