diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baaec88..3edf5cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,56 @@ -name: CI +name: CI/CD on: push: branches: [main] + tags: ['v*'] pull_request: branches: [main] jobs: - build: - # Windows runner required for Win32 API dependencies + # ── 1. 정적 분석 + 빌드 + 테스트 ────────────────────────────────────────── + test: + # Win32 API 의존성으로 Windows runner 필수 runs-on: windows-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.25' + cache: true + + - name: Vet + run: go vet ./... - name: Build run: go build -ldflags="-H windowsgui -s -w" -o launcher.exe . + + - name: Test + run: go test ./... -v + + # ── 2. 릴리즈 빌드 & GitHub Release 업로드 (태그 push 시만) ─────────────── + release: + needs: test + if: startsWith(github.ref, 'refs/tags/v') + runs-on: windows-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: '1.25' + cache: true + + - name: Build release binary + run: | + $VERSION = "${{ github.ref_name }}" + go build -ldflags="-H windowsgui -s -w -X main.version=$VERSION" -o launcher.exe . + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: launcher.exe + generate_release_notes: true