Skip to content

Release

Release #47

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ["ci"]
types: [completed]
branches: [main]
permissions:
contents: read
concurrency:
group: release-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main'
permissions:
contents: write
issues: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- name: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: go-modkit
repositories: modkit
- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ steps.app-token.outputs.token }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish-artifacts:
name: Publish CLI release artifacts
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: go-modkit
repositories: modkit
- uses: actions/checkout@v6
with:
ref: "${{ needs.release-please.outputs.tag_name }}"
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25.7"
cache-dependency-path: |
tools/tools.go
go.mod
- name: Publish CLI release artifacts
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}