ci: Gitea 환경으로 전환 (릴리즈 GitHub Actions → Gitea API)
- softprops/action-gh-release 제거 - Gitea REST API (PowerShell)로 릴리즈 생성 + launcher.exe 업로드 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
51
.github/workflows/ci.yml
vendored
51
.github/workflows/ci.yml
vendored
@@ -10,7 +10,6 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
# ── 1. 정적 분석 + 빌드 + 테스트 ──────────────────────────────────────────
|
# ── 1. 정적 분석 + 빌드 + 테스트 ──────────────────────────────────────────
|
||||||
test:
|
test:
|
||||||
# Win32 API 의존성으로 Windows runner 필수
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -29,13 +28,11 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: go test ./... -v
|
run: go test ./... -v
|
||||||
|
|
||||||
# ── 2. 릴리즈 빌드 & GitHub Release 업로드 (태그 push 시만) ───────────────
|
# ── 2. Gitea Release 생성 + launcher.exe 업로드 (태그 push 시만) ──────────
|
||||||
release:
|
release:
|
||||||
needs: test
|
needs: test
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -46,11 +43,43 @@ jobs:
|
|||||||
|
|
||||||
- name: Build release binary
|
- name: Build release binary
|
||||||
run: |
|
run: |
|
||||||
$VERSION = "${{ github.ref_name }}"
|
$version = "${{ github.ref_name }}"
|
||||||
go build -ldflags="-H windowsgui -s -w -X main.version=$VERSION" -o launcher.exe .
|
go build -ldflags="-H windowsgui -s -w -X main.version=$version" -o launcher.exe .
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create Gitea release & upload launcher.exe
|
||||||
uses: softprops/action-gh-release@v2
|
shell: pwsh
|
||||||
with:
|
run: |
|
||||||
files: launcher.exe
|
$version = "${{ github.ref_name }}"
|
||||||
generate_release_notes: true
|
$repo = "${{ github.repository }}"
|
||||||
|
$token = "${{ secrets.GITEA_TOKEN }}"
|
||||||
|
$baseUrl = "https://git.tolelom.xyz/api/v1"
|
||||||
|
|
||||||
|
$headers = @{
|
||||||
|
"Authorization" = "token $token"
|
||||||
|
"Content-Type" = "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 릴리즈 생성
|
||||||
|
$body = @{
|
||||||
|
tag_name = $version
|
||||||
|
name = $version
|
||||||
|
body = "Release $version"
|
||||||
|
} | ConvertTo-Json -Compress
|
||||||
|
|
||||||
|
$release = Invoke-RestMethod `
|
||||||
|
-Uri "$baseUrl/repos/$repo/releases" `
|
||||||
|
-Method Post `
|
||||||
|
-Headers $headers `
|
||||||
|
-Body $body
|
||||||
|
|
||||||
|
# launcher.exe 업로드
|
||||||
|
$uploadHeaders = @{
|
||||||
|
"Authorization" = "token $token"
|
||||||
|
"Content-Type" = "application/octet-stream"
|
||||||
|
}
|
||||||
|
$fileBytes = [System.IO.File]::ReadAllBytes("${{ github.workspace }}\launcher.exe")
|
||||||
|
Invoke-RestMethod `
|
||||||
|
-Uri "$baseUrl/repos/$repo/releases/$($release.id)/assets?name=launcher.exe" `
|
||||||
|
-Method Post `
|
||||||
|
-Headers $uploadHeaders `
|
||||||
|
-Body $fileBytes
|
||||||
|
|||||||
Reference in New Issue
Block a user