-
Notifications
You must be signed in to change notification settings - Fork 247
74 lines (74 loc) · 3.72 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
on: push
jobs:
build-mingw:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- env:
MSYSTEM: MINGW64
run: |
$ErrorActionPreference = "Continue"
C:\msys64\usr\bin\bash.exe -l -c "pacman -Syu --noconfirm --noprogressbar"
C:\msys64\usr\bin\bash.exe -l -c "pacman -Syu --needed --noconfirm --noprogressbar base-devel cmake git mingw-w64-x86_64-toolchain mingw-w64-x86_64-libarchive mingw-w64-x86_64-boost mingw-w64-x86_64-tinyxml2"
git fetch --unshallow --tags
C:\msys64\usr\bin\bash.exe -l -c "
cd /d/a/LxRunOffline/LxRunOffline &&
cmake -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=Release . &&
make -j && make test && make package"
if ($LASTEXITCODE -ne 0) { Exit 1 }
- if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
run: |
mkdir -Force ~\.ssh
[IO.File]::WriteAllBytes( `
"$Env:USERPROFILE\.ssh\id_ed25519", `
[Convert]::FromBase64String("${{ secrets.DEPLOYKEY }}"))
cmd /c 'ssh-keyscan web.sourceforge.net > "%USERPROFILE%\.ssh\known_hosts" 2>nul'
cmd /c "scp LxRunOffline-$(git describe --tags)-mingw.zip [email protected]:/home/project-web/ddosolitary-builds/htdocs/LxRunOffline/ 2>&1"
if ($LASTEXITCODE -ne 0) { exit 1 }
build-msvc:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@master
with:
path: ~\AppData\Local\vcpkg
key: vcpkg-cache
- env:
VCPKG_DEFAULT_TRIPLET: x64-windows-static
run: |
$ErrorActionPreference = "Continue"
pushd $Env:VCPKG_INSTALLATION_ROOT
git pull
git apply "$Env:GITHUB_WORKSPACE\misc\vcpkg-libarchive-slash.patch"
.\bootstrap-vcpkg.bat
popd
vcpkg integrate install
vcpkg install libarchive boost-program-options boost-format boost-algorithm boost-test tinyxml2
git fetch --unshallow --tags
cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" & set' |
foreach { if ($_ -match "=") { $v = $_.split("="); Set-Item -Force -Path "Env:\$($v[0])" -Value "$($v[1])" } }
cmake . `
-G "NMake Makefiles" `
-DCMAKE_TOOLCHAIN_FILE="$Env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET="$Env:VCPKG_DEFAULT_TRIPLET" `
-DCMAKE_BUILD_TYPE=Release `
-DBUILD_CHOCO_PKG=ON
nmake
nmake test
nmake package
if ($LASTEXITCODE -ne 0) { Exit 1 }
- if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
run: |
mkdir -Force ~\.ssh
[IO.File]::WriteAllBytes( `
"$Env:USERPROFILE\.ssh\id_ed25519", `
[Convert]::FromBase64String("${{ secrets.DEPLOYKEY }}"))
cmd /c 'ssh-keyscan web.sourceforge.net > "%USERPROFILE%\.ssh\known_hosts" 2>nul'
$version = git describe --tags
cmd /c "scp LxRunOffline-$version-msvc.zip [email protected]:/home/project-web/ddosolitary-builds/htdocs/LxRunOffline/ 2>&1"
if ($LASTEXITCODE -ne 0) { exit 1 }
if (-not $version.Contains("-")) {
cmake -DCOMPONENT=choco -DCMAKE_INSTALL_PREFIX="$PWD" -P cmake_install.cmake
cmd /c "scp lxrunoffline.$($version.Substring(1)).nupkg [email protected]:/home/project-web/ddosolitary-builds/htdocs/LxRunOffline/ 2>&1"
if ($LASTEXITCODE -ne 0) { exit 1 }
}