summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-18 00:48:27 +0800
committerruki <[email protected]>2023-11-20 10:45:21 +0800
commita534df592256c48fa8f8eb4da2fe70d401c9ca3a (patch)
tree92968a7fc2839e237d8c4f0ff1db9e19bf10f142
parent3b3f27c83e1c631eba0f926090403ede5130444f (diff)
update ci
-rw-r--r--.github/workflows/windows_luajit.yml61
1 files changed, 18 insertions, 43 deletions
diff --git a/.github/workflows/windows_luajit.yml b/.github/workflows/windows_luajit.yml
index 3c81db731..8b715a260 100644
--- a/.github/workflows/windows_luajit.yml
+++ b/.github/workflows/windows_luajit.yml
@@ -46,6 +46,14 @@ jobs:
Expand-Archive ./nsis-uac.zip -DestinationPath ./nsis -Force
Move-Item ./nsis/UAC.nsh ./nsis/Include/
+ - name: Set release arch name
+ run: |
+ if ("${{ matrix.arch }}" -eq "x64") {
+ Write-Output "RELEASE_NAME=win64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
+ } else {
+ Write-Output "RELEASE_NAME=win32" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
+ }
+
- name: Build
run: |
cd core
@@ -53,6 +61,15 @@ jobs:
xmake -vD
cd ..
+ - name: Artifact
+ run: |
+ cd core
+ xmake pack -vD --formats=nsis --autobuild=n -o ./artifacts/${{env.RELEASE_NAME}} --basename=xmake.exe
+ xmake pack -vD --formats=zip --autobuild=n -o ./artifacts/${{env.RELEASE_NAME}} --basename=xmake.zip
+ (Get-FileHash ./artifacts/${{env.RELEASE_NAME}}/xmake.zip -Algorithm SHA256).Hash.ToLower() + " *xmake.zip`n" | Out-File ./shafile -Encoding ASCII -NoNewLine -Append
+ Copy-Item shafile ./artifacts/${{env.RELEASE_NAME}}
+ cd ..
+
- name: Tests
run: |
Copy-Item ./core/build/xmake.exe ./xmake
@@ -64,48 +81,6 @@ jobs:
xmake show
xmake lua -v -D tests/run.lua
- - name: Set release arch name
- run: |
- if ("${{ matrix.arch }}" -eq "x64") {
- Write-Output "RELEASE_NAME=win64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
- } else {
- Write-Output "RELEASE_NAME=win32" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
- }
- - name: Artifact
- run: |
- # build installer
- (New-Item ./winenv/bin -ItemType Directory).FullName
- curl -fsSL "https://github.com/xmake-mirror/7zip/releases/download/19.00/7z19.00-${{ matrix.arch }}.zip" -o .\7zip.zip
- Expand-Archive ./7zip.zip -DestinationPath ./7zip
- Copy-Item ./7zip/7z.exe ./winenv/bin
- Copy-Item ./7zip/7z.dll ./winenv/bin
- curl -fsSL "https://curl.se/windows/dl-8.2.1_11/curl-8.2.1_11-win32-mingw.zip" -o .\curl.zip
- Expand-Archive ./curl.zip -DestinationPath ./curl
- Copy-Item ./curl/curl-8.2.1_11-win32-mingw/bin/curl.exe ./winenv/bin
- Copy-Item ./curl/curl-8.2.1_11-win32-mingw/bin/curl-ca-bundle.crt ./winenv/bin
- $version = (Get-Command xmake/xmake.exe).FileVersionInfo
- ./nsis/makensis.exe /DMAJOR=$($version.ProductMajorPart) /DMINOR=$($version.ProductMinorPart) /DALTER=$($version.ProductBuildPart) /DBUILD=$($($version.ProductVersion -split '\+')[1]) /D${{ matrix.arch }} .\scripts\installer.nsi
- (New-Item ./artifacts/${{env.RELEASE_NAME}} -ItemType Directory).FullName
- Copy-Item scripts/xmake.exe ./artifacts/${{env.RELEASE_NAME}}/xmake.exe
- # archive
- Copy-Item ./*.md ./xmake
- Copy-Item ./winenv ./xmake -Recurse
- 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())
- (Get-FileHash .\archive.zip -Algorithm SHA256).Hash.ToLower() + " *xmake.zip`n" | Out-File ./shafile -Encoding ASCII -NoNewLine -Append
- Copy-Item archive.zip ./artifacts/${{env.RELEASE_NAME}}
- Copy-Item shafile ./artifacts/${{env.RELEASE_NAME}}
-
# upload artifacts
- uses: actions/upload-artifact@v2
with:
@@ -114,7 +89,7 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: xmake-latest.${{ env.RELEASE_NAME }}.zip
- path: artifacts/${{env.RELEASE_NAME}}/archive.zip
+ path: artifacts/${{env.RELEASE_NAME}}/xmake.zip
- uses: actions/upload-artifact@v2
with:
name: xmake-latest.${{ env.RELEASE_NAME }}.sha256