Skip to content

Commit

Permalink
ci: integrate goreleaser action for release management
Browse files Browse the repository at this point in the history
  • Loading branch information
fyvri committed Dec 28, 2024
1 parent f5b0c62 commit 9d8bc2d
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release Version

on:
push:
tags:
- "v*"

permissions: write-all

jobs:
build:
name: Build and Testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Init tag version name
run: |
echo "TAG_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean --config ./deployments/goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
DOCKER_REPOSITORY: ${{ vars.DOCKER_REPOSITORY }}
TAG_VERSION: ${{ env.TAG_VERSION }}

0 comments on commit 9d8bc2d

Please sign in to comment.