9191 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
9292 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
9393
94- build-binaries :
94+ build-unix- binaries :
9595 if : needs.release.outputs.new_release_published == 'true'
9696 name : Build ${{ matrix.os }} release assets
9797 needs :
@@ -107,15 +107,9 @@ jobs:
107107 - os : ubuntu-latest
108108 asset_os : linux
109109 asset_arch : amd64
110- archive_format : tar.gz
111110 - os : macos-latest
112111 asset_os : darwin
113112 asset_arch : arm64
114- archive_format : tar.gz
115- - os : windows-latest
116- asset_os : windows
117- asset_arch : amd64
118- archive_format : zip
119113
120114 steps :
121115 - name : Check out repository
@@ -148,21 +142,72 @@ jobs:
148142 $assetBase = "putio-cli-$version-${{ matrix.asset_os }}-${{ matrix.asset_arch }}"
149143 $releaseDir = ".artifacts/release"
150144 New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null
145+ $binaryPath = ".artifacts/sea/putio"
146+ $stageDir = "$releaseDir/stage"
147+ New-Item -ItemType Directory -Force -Path $stageDir | Out-Null
148+ Copy-Item $binaryPath "$stageDir/putio"
149+ tar -czf "$releaseDir/$assetBase.tar.gz" -C $stageDir putio
150+ Remove-Item -Recurse -Force $stageDir
151+ $assetPath = "$releaseDir/$assetBase.tar.gz"
152+
153+ $hash = (Get-FileHash -Algorithm SHA256 $assetPath).Hash.ToLower()
154+ "$hash $(Split-Path $assetPath -Leaf)" | Out-File "$assetPath.sha256" -Encoding ascii -NoNewline
155+
156+ - name : Generate SHA-256 checksums
157+ shell : pwsh
158+ run : Get-ChildItem .artifacts/release
159+
160+ - name : Upload binary assets to the GitHub release
161+ uses : softprops/action-gh-release@v2
162+ with :
163+ tag_name : ${{ needs.release.outputs.new_release_git_tag }}
164+ files : |
165+ .artifacts/release/*
151166
152- if ("${{ runner.os }}" -eq "Windows") {
153- $binaryPath = ".artifacts/sea/putio.exe"
154- Compress-Archive -Path $binaryPath -DestinationPath "$releaseDir/$assetBase.zip" -Force
155- $assetPath = "$releaseDir/$assetBase.zip"
156- } else {
157- $binaryPath = ".artifacts/sea/putio"
158- $stageDir = "$releaseDir/stage"
159- New-Item -ItemType Directory -Force -Path $stageDir | Out-Null
160- Copy-Item $binaryPath "$stageDir/putio"
161- tar -czf "$releaseDir/$assetBase.tar.gz" -C $stageDir putio
162- Remove-Item -Recurse -Force $stageDir
163- $assetPath = "$releaseDir/$assetBase.tar.gz"
164- }
167+ build-windows-binary :
168+ if : needs.release.outputs.new_release_published == 'true'
169+ name : Build windows-latest release assets
170+ needs :
171+ - release
172+ runs-on : windows-latest
173+ timeout-minutes : 30
174+ permissions :
175+ contents : write
165176
177+ steps :
178+ - name : Check out repository
179+ uses : actions/checkout@v6
180+ with :
181+ fetch-depth : 0
182+
183+ - name : Check out release tag
184+ run : git checkout ${{ needs.release.outputs.new_release_git_tag }}
185+
186+ - name : Set up Vite+
187+ uses : voidzero-dev/setup-vp@v1
188+ with :
189+ node-version-file : " .node-version"
190+ cache : true
191+
192+ - name : Install dependencies
193+ run : vp install
194+
195+ - name : Build SEA binary
196+ run : vp run build:sea
197+
198+ - name : Verify SEA binary
199+ run : vp run verify:sea
200+
201+ - name : Package release assets
202+ shell : pwsh
203+ run : |
204+ $version = "${{ needs.release.outputs.new_release_version }}"
205+ $assetBase = "putio-cli-$version-windows-amd64"
206+ $releaseDir = ".artifacts/release"
207+ New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null
208+ $binaryPath = ".artifacts/sea/putio.exe"
209+ Compress-Archive -Path $binaryPath -DestinationPath "$releaseDir/$assetBase.zip" -Force
210+ $assetPath = "$releaseDir/$assetBase.zip"
166211 $hash = (Get-FileHash -Algorithm SHA256 $assetPath).Hash.ToLower()
167212 "$hash $(Split-Path $assetPath -Leaf)" | Out-File "$assetPath.sha256" -Encoding ascii -NoNewline
168213
@@ -182,7 +227,7 @@ jobs:
182227 name : Update Homebrew tap
183228 needs :
184229 - release
185- - build-binaries
230+ - build-unix- binaries
186231 runs-on : ubuntu-latest
187232 timeout-minutes : 20
188233 permissions :
@@ -197,6 +242,7 @@ jobs:
197242 github_token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
198243 commit_owner : semantic-release-bot
199244 commit_email : ui@put.io
245+ branch : main
200246 formula_folder : Formula
201247 formula_name : putio
202248 install : ' bin.install "putio"'
0 commit comments