Add binary folders structure definition for goreleaser #13
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 # Esegue build snapshot per ogni push su main | |
tags: | |
- 'v*' # Esegue una release ufficiale quando il tag inizia con 'v' | |
env: | |
GORELEASER_VERSION: v2.3.2 | |
jobs: | |
build: | |
name: Build and Release for Supported Architectures | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout del codice | |
- name: Checkout Repository | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
with: | |
show-progress: false | |
# Setup di Go | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23.2' | |
# Installazione di GoReleaser | |
- name: Install GoReleaser | |
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 | |
with: | |
version: ${{ env.GORELEASER_VERSION }} | |
install-only: true | |
# Esecuzione di GoReleaser per snapshot build (su main) | |
- name: Run GoReleaser (Snapshot) | |
if: github.ref == 'refs/heads/main' | |
run: goreleaser release --snapshot --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Esecuzione di GoReleaser per rilasci ufficiali (su tag) | |
- name: Run GoReleaser (Release) | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: goreleaser release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Salva i binari come artefatti in snapshot build | |
- name: Upload artifact (Snapshot) | |
if: github.ref == 'refs/heads/main' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: bin/ |