From 99f215cb7c673c299075b0cc8d0c3c0e03c5b1d5 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sun, 7 Dec 2025 13:33:46 +0000 Subject: [PATCH] Move build and release to shared workflow --- .github/workflows/release.yml | 85 ++++------------------------------- 1 file changed, 8 insertions(+), 77 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 341c129..f62f2f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,82 +10,13 @@ on: - "go.sum" workflow_dispatch: +permissions: + contents: write + jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: "1.24" - - - name: Run tests - run: go test -race -v ./... - - version: - needs: test - runs-on: ubuntu-latest - outputs: - version: ${{ steps.version_formatted.outputs.version }} - version_tag: ${{ steps.version_formatted.outputs.version_tag }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Calculate version - id: semver - uses: lukaszraczylo/semver-generator@v1 - with: - config_file: semver.yaml - repository_local: true - - - name: Format version - id: version_formatted - run: | - VERSION="${{ steps.semver.outputs.semantic_version }}" - echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "version_tag=v${VERSION}" >> $GITHUB_OUTPUT - - - name: Print version - run: | - echo "Version: ${{ steps.version_formatted.outputs.version }}" - echo "Version tag: ${{ steps.version_formatted.outputs.version_tag }}" - release: - needs: version - if: needs.version.outputs.version_tag != '' - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: "1.24" - - - name: Create and push tag - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git tag -a ${{ needs.version.outputs.version_tag }} -m "Release ${{ needs.version.outputs.version }}" - git push origin ${{ needs.version.outputs.version_tag }} - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 - with: - distribution: goreleaser - version: "~> v2" - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + uses: lukaszraczylo/shared-actions/.github/workflows/go-release.yaml@main + with: + go-version: "1.24" + secrets: + homebrew-tap-token: ${{ secrets.HOMEBREW_TAP_TOKEN }}