Skip to content

chore: help agents to split up feedback into smaller messages (#1852) #1929

chore: help agents to split up feedback into smaller messages (#1852)

chore: help agents to split up feedback into smaller messages (#1852) #1929

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
is_draft:
description: 'Is this a draft release?'
required: false
type: boolean
default: false
permissions:
contents: write
packages: write
jobs:
release:
name: Release
runs-on:
group: windows-latest-large
if: startsWith(github.event.head_commit.message, 'ci:') != true
outputs:
tag: ${{ steps.changelog.outputs.tag }}
steps:
- name: Setup environment
run: |-
chcp 65001 #set code page to utf-8
echo ("GOPRIVATE=github.com/speakeasy-api") >> $env:GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Conventional Commits
id: changelog
uses: TriPSs/conventional-changelog-action@84dadaf2c367cb52af02737cd9c7e888807219e7 # v6.2.0
with:
github-token: ${{ secrets.github_token }}
skip-commit: "true"
output-file: "false"
skip-on-empty: "false"
preset: conventionalcommits
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: "go.mod"
# Reference: https://github.com/actions/setup-go/issues/495
cache: false
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- name: Configure git for private modules
run: git config --global url."https://speakeasybot:${{ secrets.BOT_REPO_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Setup Choco
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
with:
args: --version
- name: goreleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
distribution: goreleaser
version: latest
args: release --clean ${{ inputs.is_draft == true && '--draft' || '' }} ${{ vars.SKIP_CHOCOLATEY == 'true' && '--skip=chocolatey' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_REPO_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
IS_DRAFT: ${{ inputs.is_draft }}
- name: Upload dist artifacts for docker build
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: dist
path: dist/
retention-days: 1
docker:
name: Build Docker Images
runs-on:
group: ubuntu-latest-large
needs: release
if: needs.release.outputs.tag != ''
env:
REGISTRY: ghcr.io
IMAGE_NAME: speakeasy-api/speakeasy
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Download dist artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: dist
path: dist/
- name: Organize binaries for Docker build
run: |
mkdir -p linux/amd64 linux/arm64
cp dist/speakeasy_linux_amd64_v1/speakeasy linux/amd64/speakeasy
cp dist/speakeasy_linux_arm64_v8.0/speakeasy linux/arm64/speakeasy
chmod +x linux/amd64/speakeasy linux/arm64/speakeasy
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{raw}},value=${{ needs.release.outputs.tag }}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ inputs.is_draft != true }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
reconcile:
name: Trigger Changelog Reconcile
runs-on: ubuntu-latest
needs: docker
if: needs.docker.result == 'success' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.is_draft == false))
steps:
- name: Trigger changelog reconcile
run: gh workflow run changelog-reconcile.yml --repo speakeasy-api/marketing-site --ref main
env:
GH_TOKEN: ${{ secrets.BOT_REPO_TOKEN }}