From 617804bcbc5b5c807ab405a452fdb29dcb8c2818 Mon Sep 17 00:00:00 2001 From: Federico Nafria Date: Sat, 6 Sep 2025 17:30:17 +0200 Subject: [PATCH] chore: Improve release workflow and enable version embedding --- .github/workflows/ci-and-release.yml | 17 +++++++++++------ cmd/patt/main.go | 4 +++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-and-release.yml b/.github/workflows/ci-and-release.yml index a5a1e87..814a680 100644 --- a/.github/workflows/ci-and-release.yml +++ b/.github/workflows/ci-and-release.yml @@ -2,7 +2,7 @@ name: CI and Release on: push: - branches: + branches: - '**' tags: - 'v*' @@ -24,7 +24,10 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.24' + + - name: Tidy modules + run: go mod tidy - name: Run tests run: go test -v ./... @@ -46,7 +49,10 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.24' + + - name: Tidy modules + run: go mod tidy - name: Run tests run: go test -v ./... @@ -82,7 +88,7 @@ jobs: sha256sum * > checksums.txt - name: Create GitHub Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: | dist/* @@ -90,5 +96,4 @@ jobs: draft: false prerelease: false env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/cmd/patt/main.go b/cmd/patt/main.go index 7655e07..6d14a82 100644 --- a/cmd/patt/main.go +++ b/cmd/patt/main.go @@ -7,6 +7,8 @@ import ( "patt" ) +var version = "dev" + func main() { ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) defer stop() @@ -18,4 +20,4 @@ func exitIfErr(err error) { _, _ = os.Stderr.WriteString(err.Error() + "\n") os.Exit(1) } -} +} \ No newline at end of file