feat(makefile): make build cmd smarter #3
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: | |
# Commented out until we add tests | |
# test: | |
# strategy: | |
# fail-fast: true | |
# matrix: | |
# os: [ ubuntu-latest, macos-latest, windows-latest ] | |
# name: Test ${{ 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 | |
# run: go test ./... | |
goreleaserbuild: | |
name: Build distribution binaries | |
runs-on: ubuntu-latest | |
# Remove dependency on test job | |
# 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 |