catApi/.github/workflows/release.yml
2023-10-27 10:55:04 +03:00

39 lines
771 B
YAML

name: Go Build & Release CI
on:
workflow_dispatch:
push:
tags:
- "v*"
pull_request:
branch: dev
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}