From 03345d18b9d18b882c8a573fe88bf5f585e3ca38 Mon Sep 17 00:00:00 2001 From: tolelom <98kimsungmin@naver.com> Date: Wed, 18 Mar 2026 17:25:31 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20Gitea=20=ED=99=98=EA=B2=BD=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=84=ED=99=98=20(=EB=A6=B4=EB=A6=AC=EC=A6=88?= =?UTF-8?q?=20GitHub=20Actions=20=E2=86=92=20Gitea=20API)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - softprops/action-gh-release 제거 - Gitea REST API (PowerShell)로 릴리즈 생성 + launcher.exe 업로드 Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 51 +++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3edf5cf..e96216e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ on: jobs: # ── 1. 정적 분석 + 빌드 + 테스트 ────────────────────────────────────────── test: - # Win32 API 의존성으로 Windows runner 필수 runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -29,13 +28,11 @@ jobs: - name: Test run: go test ./... -v - # ── 2. 릴리즈 빌드 & GitHub Release 업로드 (태그 push 시만) ─────────────── + # ── 2. Gitea Release 생성 + launcher.exe 업로드 (태그 push 시만) ────────── release: needs: test if: startsWith(github.ref, 'refs/tags/v') runs-on: windows-latest - permissions: - contents: write steps: - uses: actions/checkout@v4 @@ -46,11 +43,43 @@ jobs: - name: Build release binary run: | - $VERSION = "${{ github.ref_name }}" - go build -ldflags="-H windowsgui -s -w -X main.version=$VERSION" -o launcher.exe . + $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 + - name: Create Gitea release & upload launcher.exe + shell: pwsh + run: | + $version = "${{ github.ref_name }}" + $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