Skip to content

Commit

Permalink
Fix-version-in-build (#695)
Browse files Browse the repository at this point in the history
* refactor: update GoReleaser configuration for improved archive formats and release handling

* refactor: update GitHub Actions workflow for GoReleaser to use tag-based triggers and improve environment variable handling

* chore: remove obsolete release and test workflows
  • Loading branch information
simulot authored Feb 9, 2025
1 parent 3881a31 commit ce0da8d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 302 deletions.
63 changes: 38 additions & 25 deletions .github/workflows/gorelaser.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: goreleaser
name: Build and release

on:
label:
types: created

# label:
# types: created
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: write
Expand All @@ -12,25 +15,35 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache-dependency-path: "go.sum"

- name: Set tag reference from input
if: github.event.ref != ''
run: |
echo "GIT_REF=refs/tags/${{ github.event.ref}}" >> $GITHUB_ENV
- name: Set tag reference from github.ref
if: github.ref != ''
run: |
echo "GIT_REF=${{ github.ref }}" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.GIT_REF }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache-dependency-path: "go.sum"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67 changes: 0 additions & 67 deletions .github/workflows/release.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/test.yml

This file was deleted.

Loading

0 comments on commit ce0da8d

Please # to comment.