mirror of
https://github.com/koho/frpmgr.git
synced 2025-10-20 16:03:47 +08:00
Upload the build output of pull requests (#122)
* Upload the build output of pull requests * Fix incorrect commit sha
This commit is contained in:
22
.github/workflows/tests.yml
vendored
22
.github/workflows/tests.yml
vendored
@ -25,10 +25,32 @@ jobs:
|
||||
run: |
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -latest -property installationPath`) do echo %%i\VC\Auxiliary\Build>>%GITHUB_PATH%
|
||||
|
||||
- name: Add commit hash to version number
|
||||
shell: powershell
|
||||
if: github.event_name == 'pull_request'
|
||||
env:
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
$versionFile = ".\pkg\version\version.go"
|
||||
$rev = [UInt16]("0x" + $env:HEAD_SHA.Substring(0, 4))
|
||||
$version = (findstr /r "Number.*=.*[0-9.]*" $versionFile | Select-Object -First 1 | ConvertFrom-StringData).Get_Item("Number")
|
||||
$newVersion = $version.Substring(0, $version.Length - 1) + ".$rev" + '"'
|
||||
(Get-Content $versionFile).Replace($version, $newVersion) | Set-Content $versionFile
|
||||
|
||||
- name: Build
|
||||
shell: cmd
|
||||
run: build.bat
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
name: build
|
||||
path: |
|
||||
bin/*.exe
|
||||
bin/*.zip
|
||||
retention-days: 5
|
||||
|
||||
test:
|
||||
name: Go
|
||||
runs-on: windows-latest
|
||||
|
Reference in New Issue
Block a user