Skip to content

ci: build and release when that commit tagged #2

ci: build and release when that commit tagged

ci: build and release when that commit tagged #2

Workflow file for this run

name: Build & Release
on:
push:
tags: ["*"] # 태그 푸시가 트리거
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# 1) CHANGELOG·릴리스 PR & 태그 자동화
- name: Release Please
uses: google-github-actions/release-please-action@v2
with:
# Go 프로젝트라면 'go', 단순 바이너리면 'simple'
release-type: go
token: ${{ secrets.GITHUB_TOKEN }}
# section 설정 → docs·chore 등은 섹션을 안 적으면 자동 제외된다
changelog-types: |
[
{ "type": "feat", "section": "🚀 Features" },
{ "type": "fix", "section": "🐞 Bug Fixes" },
{ "type": "perf", "section": "⚡ Performance" }
]
# 2) 여러 플랫폼 빌드
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Build binaries
run: |
targets="linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64"
for t in $targets; do
IFS=/ read GOOS GOARCH <<<"$t"
out="lmt_${GOOS}_${GOARCH}$( [ "$GOOS" = windows ] && echo .exe )"
env GOOS=$GOOS GOARCH=$GOARCH go build -o "$out" cmd/server/main.go
done
# 3) 릴리스 자산 업로드
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: lmt_*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}