feat(perf): rework elements #95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- "main" | |
- "develop" | |
tags: | |
- "v*" | |
paths-ignore: | |
- ".github/ISSUE_TEMPLATE/**" | |
- ".github/images/**" | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- ".github/ISSUE_TEMPLATE/**" | |
- ".github/images/**" | |
- "**.md" | |
env: | |
REGISTRY: ghcr.io | |
REGISTRY_IMAGE: ghcr.io/${{ github.repository }} | |
GO_VERSION: "1.23.4" | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
test: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
name: Test on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
- name: Run Tests | |
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
run: go test -v ./... | |
goreleaserbuild: | |
name: Build distribution binaries | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
- name: Run GoReleaser build | |
if: github.event_name == 'pull_request' | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: "~> v2" | |
args: release --clean --skip=validate,publish --parallelism 5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILDER: ${{ github.actor }}@github-actions | |
- name: Run GoReleaser build and publish tags | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: "~> v2" | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILDER: ${{ github.actor }}@github-actions | |
- name: Upload assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mkbrr | |
path: | | |
dist/*.tar.gz | |
dist/*.zip | |
dist/*.deb | |
dist/*.rpm |