Skip to content

ci(release): refactor release workflow #12

ci(release): refactor release workflow

ci(release): refactor release workflow #12

Workflow file for this run

name: Release
on:
push:
tags: ["v*.*.**"]
workflow_dispatch:
inputs:
tag:
description: "Target tag to release"
required: true
type: string
env:
PGO_FILE: "default.pgo"
jobs:
release:
runs-on: ubuntu-latest
container:
image: ghcr.io/goreleaser/goreleaser-cross:latest
steps:
- uses: actions/checkout@master
with:
ref: "${{ inputs.tag || github.ref_name }}"
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: '**/go.sum'
- uses: actions/download-artifact@v4
id: artifact
with:
name: pgo
continue-on-error: true
- name: Build PGO file
run: '[ -f "${{ env.PGO_FILE }}" ] || make pgo'
- run: git config --global --add safe.directory "$(pwd)"
- run: goreleaser release --clean
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"