Skip to content

Commit

Permalink
build: release on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Michsior14 committed Dec 30, 2023
1 parent 26bf55a commit aa86cb4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 27 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
run: go test -race -v ./...

build:
if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
name: Build
needs: [lint, test]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -77,29 +76,3 @@ jobs:
name: ${{ env.app }}
path: ${{ env.app }}
if-no-files-found: error

release:
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
name: Release
needs: [lint, test]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
tags:
- "*"

permissions:
contents: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch tags
run: git fetch --force --tags

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

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit aa86cb4

Please sign in to comment.