65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
branches: ["**"]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
quality-and-release:
|
|
name: Quality & Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.24"
|
|
cache: true
|
|
|
|
- name: Tidy
|
|
run: go mod tidy
|
|
|
|
- name: Run Linter
|
|
uses: golangci/golangci-lint-action@v8
|
|
with:
|
|
version: v2.11.4
|
|
|
|
- name: Run Tests
|
|
run: go test -v ./...
|
|
|
|
- name: Create vendor tarball
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
go mod vendor
|
|
tar -czf iris-${GITHUB_REF_NAME#v}-vendor.tar.gz vendor/
|
|
sha256sum iris-${GITHUB_REF_NAME#v}-vendor.tar.gz > iris-${GITHUB_REF_NAME#v}-vendor.tar.gz.sha256
|
|
|
|
- name: Run GoReleaser
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
AUR_KEY: ${{ secrets.AUR_KEY }}
|
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|