From 9e955707b28bfec1eb32ff1f1ff4fc9d97c8412a Mon Sep 17 00:00:00 2001 From: yujeong-jeon Date: Fri, 6 Feb 2026 23:59:09 +0900 Subject: [PATCH] Refactor release asset upload process to use GitHub CLI for asset uploads and remove redundant steps --- .github/workflows/release-asset.yaml | 45 +++++++--------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release-asset.yaml b/.github/workflows/release-asset.yaml index 3f80c84..a7d8e67 100644 --- a/.github/workflows/release-asset.yaml +++ b/.github/workflows/release-asset.yaml @@ -74,44 +74,21 @@ jobs: # Build for Linux AMD64 GOOS=linux GOARCH=amd64 go build -o dist/commithelper-go-linux-amd64 main.go - - name: getReleaseUploadUrl - id: getRelease + - name: Upload release assets run: | packageName="${{ inputs.package }}" packageVersion="${{ inputs.version }}" releaseTag="$packageName@$packageVersion" - apiUrl="https://api.github.com/repos/NaverPayDev/cli/releases/tags/$releaseTag" - uploadUrl=$(curl -s -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN }}" $apiUrl | jq -r '.upload_url') - echo "upload_url=$uploadUrl" >> $GITHUB_ENV - - name: uploadWindowsBinary - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ env.upload_url }} - asset_path: packages/commithelper-go/dist/commithelper-go-windows-amd64.exe - asset_name: commithelper-go-windows-amd64.exe - asset_content_type: application/octet-stream + echo "🔍 Uploading assets for release: $releaseTag" - - name: uploadMacosAmd64Binary - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ env.upload_url }} - asset_path: packages/commithelper-go/dist/commithelper-go-darwin-amd64 - asset_name: commithelper-go-darwin-amd64 - asset_content_type: application/octet-stream + gh release upload "$releaseTag" \ + packages/commithelper-go/dist/commithelper-go-windows-amd64.exe \ + packages/commithelper-go/dist/commithelper-go-darwin-amd64 \ + packages/commithelper-go/dist/commithelper-go-darwin-arm64 \ + packages/commithelper-go/dist/commithelper-go-linux-amd64 \ + --clobber - - name: uploadMacosArm64Binary - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ env.upload_url }} - asset_path: packages/commithelper-go/dist/commithelper-go-darwin-arm64 - asset_name: commithelper-go-darwin-arm64 - asset_content_type: application/octet-stream - - - name: uploadLinuxBinary - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ env.upload_url }} - asset_path: packages/commithelper-go/dist/commithelper-go-linux-amd64 - asset_name: commithelper-go-linux-amd64 - asset_content_type: application/octet-stream + echo "✅ All assets uploaded successfully!" + env: + GH_TOKEN: ${{ secrets.ACTION_TOKEN }}