diff options
| author | ruki <[email protected]> | 2019-06-20 22:49:13 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-06-20 22:49:13 +0800 |
| commit | d579b3548cd467f0e7b0462733b8de882abf6119 (patch) | |
| tree | 5cd64f6bff2fd8fe7debe053257dce9e1043b8b6 | |
| parent | f36cd220cbf087247254b1f6700dd89c6b62428a (diff) | |
| parent | f38741505acb528f609a8b269c911fc037a03fcc (diff) | |
Merge pull request #464 from OpportunityLiu/ci
Fix CI archive
| -rw-r--r-- | .appveyor.yml | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 144fd6438..9841e52de 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -49,6 +49,7 @@ build_script: after_build: # publish exe - ps: Push-AppveyorArtifact .\core\build\xmake.exe -FileName xmake.exe -DeploymentName "xmake-executable" + - ps: (Get-FileHash .\core\build\xmake.exe -Algorithm SHA256).Hash.ToLower() + " *xmake.exe`n" | Out-File ./shafile -Encoding ASCII -NoNewLine # compose & publish installer - ps: Copy-Item C:\winenv\ . -Recurse - ps: $version = (Get-Command xmake).FileVersionInfo @@ -60,12 +61,31 @@ after_build: /D$($env:platform) .\scripts\installer.nsi - ps: Push-AppveyorArtifact .\scripts\xmake.exe -FileName xmake-installer.exe -DeploymentName "xmake-installer" + - ps: (Get-FileHash .\scripts\xmake.exe -Algorithm SHA256).Hash.ToLower() + " *xmake-installer.exe`n" | Out-File ./shafile -Encoding ASCII -NoNewLine -Append # publish zip archive - ps: Copy-Item .\*.md .\xmake - ps: Copy-Item C:\winenv\ .\xmake -Recurse - ps: Copy-Item .\core\build\xmake.exe .\xmake - - ps: Compress-Archive -Path .\xmake\* -DestinationPath .\archive.zip -CompressionLevel Optimal + - ps: |- + Add-Type -AssemblyName System.Text.Encoding + Add-Type -AssemblyName System.IO.Compression.FileSystem + + class FixedEncoder : System.Text.UTF8Encoding { + FixedEncoder() : base($true) { } + + [byte[]] GetBytes([string] $s) + { + $s = $s.Replace("\", "/") + return ([System.Text.UTF8Encoding]$this).GetBytes($s) + } + } + Copy-Item .\xmake .\archive\xmake -Recurse + + [System.IO.Compression.ZipFile]::CreateFromDirectory("$PWD\archive", "$PWD\archive.zip", [System.IO.Compression.CompressionLevel]::Optimal, $false, [FixedEncoder]::new()) - ps: Push-AppveyorArtifact .\archive.zip -FileName xmake.zip -DeploymentName "xmake-archive" + - ps: (Get-FileHash .\archive.zip -Algorithm SHA256).Hash.ToLower() + " *xmake.zip`n" | Out-File ./shafile -Encoding ASCII -NoNewLine -Append + # publish sha file + - ps: Push-AppveyorArtifact ./shafile -FileName xmake.sha256 -DeploymentName "xmake-shafile" test_script: - ps: xmake --version |
