Chore: update build
This commit is contained in:
parent
dd95d335d9
commit
c8e2b30540
71
.github/workflows/build-windows-amd.yml
vendored
71
.github/workflows/build-windows-amd.yml
vendored
@ -50,26 +50,61 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
#if: startsWith(github.ref, 'refs/tags/')
|
#if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
$env:CGO_ENABLED=1; go build -tags build_actions -trimpath -ldflags '-w -s -buildid=' -o bin/clash-windows-amd64.exe
|
$env:CGO_ENABLED=1; go build -tags build_actions -trimpath -ldflags '-w -s -buildid=' -o bin/clash-plus-windows-amd64.exe
|
||||||
$env:GOAMD64="v3"; $env:CGO_ENABLED=1; go build -tags build_actions -trimpath -ldflags '-w -s -buildid=' -o bin/clash-windows-amd64-v3.exe
|
$env:GOAMD64="v3"; $env:CGO_ENABLED=1; go build -tags build_actions -trimpath -ldflags '-w -s -buildid=' -o bin/clash-plus-windows-amd64-v3.exe
|
||||||
|
|
||||||
|
$version = Get-Date -Format 'yyyy.MM.dd'
|
||||||
|
|
||||||
cd bin/
|
cd bin/
|
||||||
Compress-Archive -Path clash-windows-amd64.exe -DestinationPath clash-plus-windows-amd64-$(Get-Date -Format 'yyyy.MM.dd').zip
|
Compress-Archive -Path clash-plus-windows-amd64.exe -DestinationPath clash-plus-windows-amd64-$version.zip
|
||||||
Compress-Archive -Path clash-windows-amd64-v3.exe -DestinationPath clash-plus-windows-amd64-v3-$(Get-Date -Format 'yyyy.MM.dd').zip
|
Compress-Archive -Path clash-plus-windows-amd64-v3.exe -DestinationPath clash-plus-windows-amd64-v3-$version.zip
|
||||||
Remove-Item -Force clash-windows-amd64.exe
|
Remove-Item -Force clash-plus-windows-amd64.exe
|
||||||
Remove-Item -Force clash-windows-amd64-v3.exe
|
Remove-Item -Force clash-plus-windows-amd64-v3.exe
|
||||||
"$(Get-Date -Format 'yyyy.MM.dd')" | Out-File version.txt -NoNewLine
|
"$version" | Out-File version.txt -NoNewLine
|
||||||
|
|
||||||
- name: Upload files to Artifacts
|
curl `
|
||||||
uses: actions/upload-artifact@v2
|
-X PATCH `
|
||||||
with:
|
-H "Accept: application/vnd.github.v3+json" `
|
||||||
name: clash-windows-amd64-${{ steps.test.outputs.file_sha }}-${{ steps.test.outputs.file_date }}
|
-H "Authorization: token $env:GITHUB_TOKEN" `
|
||||||
path: |
|
https://api.github.com/repos/yaling888/clash/releases/66325518 `
|
||||||
bin/*
|
-d '{"name":"Plus Pro $version","draft":true}' | Out-Null
|
||||||
|
|
||||||
- name: Delete workflow runs
|
curl `
|
||||||
uses: GitRML/delete-workflow-runs@main
|
-X POST `
|
||||||
with:
|
-H "Content-Type: application/zip" `
|
||||||
retain_days: 1
|
-T "clash-plus-windows-amd64-$version.zip" `
|
||||||
keep_minimum_runs: 2
|
-H "Accept: application/vnd.github.v3+json" `
|
||||||
|
-H "Authorization: token $env:GITHUB_TOKEN" `
|
||||||
|
"https://uploads.github.com/repos/yaling888/clash/releases/66325518/assets?name=clash-plus-windows-amd64-$version.zip" | Out-Null
|
||||||
|
|
||||||
|
curl `
|
||||||
|
-X POST `
|
||||||
|
-H "Content-Type: application/zip" `
|
||||||
|
-T "clash-plus-windows-amd64-v3-$version.zip" `
|
||||||
|
-H "Accept: application/vnd.github.v3+json" `
|
||||||
|
-H "Authorization: token $env:GITHUB_TOKEN" `
|
||||||
|
"https://uploads.github.com/repos/yaling888/clash/releases/66325518/assets?name=clash-plus-windows-amd64-v3-$version.zip" | Out-Null
|
||||||
|
|
||||||
|
curl `
|
||||||
|
-X POST `
|
||||||
|
-H "Content-Type: text/plain" `
|
||||||
|
-T "version.txt" `
|
||||||
|
-H "Accept: application/vnd.github.v3+json" `
|
||||||
|
-H "Authorization: token $env:GITHUB_TOKEN" `
|
||||||
|
https://uploads.github.com/repos/yaling888/clash/releases/66325518/assets?name=version-1.txt | Out-Null
|
||||||
|
|
||||||
|
#- name: Upload files to Artifacts
|
||||||
|
# uses: actions/upload-artifact@v2
|
||||||
|
# with:
|
||||||
|
# name: clash-windows-amd64-${{ steps.test.outputs.file_sha }}-${{ steps.test.outputs.file_date }}
|
||||||
|
# path: |
|
||||||
|
# bin/*
|
||||||
|
|
||||||
|
#- name: Delete workflow runs
|
||||||
|
# uses: GitRML/delete-workflow-runs@main
|
||||||
|
# with:
|
||||||
|
# retain_days: 1
|
||||||
|
# keep_minimum_runs: 2
|
||||||
|
Reference in New Issue
Block a user