Skip to content

Commit

Permalink
Actions winserver 2019 (#1336)
Browse files Browse the repository at this point in the history
* 用 Windows Server 2019 打包

* allow to overwrite
  • Loading branch information
Him188 authored Dec 18, 2024
1 parent 7bb3ace commit 8282a4f
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 9 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
fail-fast: false
matrix:
id:
- 'windows'
- 'windows-self-hosted'
- 'windows-2019'
- 'ubuntu-x64'
- 'macos-x64'
- 'macos-aarch64'
Expand All @@ -31,9 +32,9 @@ jobs:
extraGradleArgs:
- '-Pani.android.abis=x86_64'
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DBoost_INCLUDE_DIR=C:/vcpkg/installed/x64-windows/include" "-Dorg.gradle.jvmargs=-Xmx6g" "-Dkotlin.daemon.jvm.options=-Xmx6g" "--parallel" "-Pani.android.abis=x86_64"'
id: 'windows'
id: 'windows-self-hosted'
installNativeDeps: false
name: 'Windows x86_64'
name: 'Windows 10 x86_64'
os: 'windows'
runTests: true
runsOn:
Expand All @@ -42,6 +43,24 @@ jobs:
- 'X64'
selfHosted: true
uploadApk: false
uploadDesktopInstallers: false
- arch: 'x64'
buildAnitorrent: true
buildAnitorrentSeparately: false
buildIosFramework: false
composeResourceTriple: 'windows-x64'
extraGradleArgs:
- '-Pani.android.abis=x86_64'
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DBoost_INCLUDE_DIR=C:/vcpkg/installed/x64-windows/include" "-Dorg.gradle.jvmargs=-Xmx4g" "-Dkotlin.daemon.jvm.options=-Xmx4g" "--parallel" "-Pani.android.abis=x86_64"'
id: 'windows-2019'
installNativeDeps: true
name: 'Windows Server 2019 x86_64'
os: 'windows'
runTests: true
runsOn:
- 'windows-2019'
selfHosted: false
uploadApk: false
uploadDesktopInstallers: true
- arch: 'x64'
buildAnitorrent: false
Expand Down Expand Up @@ -313,13 +332,15 @@ jobs:
with:
name: 'anitorrent-cmake-cache-${{ matrix.os }}-${{ matrix.arch }}'
path: 'torrent/anitorrent/build-ci/CMakeCache.txt'
overwrite: 'true'
if: '${{ matrix.buildAnitorrent }}'
- id: 'step-30'
name: 'Upload Anitorrent ${{ matrix.composeResourceTriple }}'
uses: 'actions/upload-artifact@v4'
with:
name: 'anitorrent-${{ matrix.composeResourceTriple }}'
path: 'app/desktop/appResources/${{ matrix.composeResourceTriple }}/anitorrent'
overwrite: 'true'
if: '${{ matrix.buildAnitorrent }}'
- id: 'step-31'
name: 'Package Desktop'
Expand All @@ -338,13 +359,15 @@ jobs:
with:
name: 'ani-macos-dmg-${{ matrix.arch }}'
path: 'app/desktop/build/compose/binaries/main-release/dmg/Ani-*.dmg'
overwrite: 'true'
if: '${{ (matrix.uploadDesktopInstallers) && ((matrix.os == ''macos'')) }}'
- id: 'step-34'
name: 'Upload Windows packages'
uses: 'actions/upload-artifact@v4'
with:
name: 'ani-windows-portable'
path: 'app/desktop/build/compose/binaries/main-release/app'
overwrite: 'true'
if: '${{ (matrix.uploadDesktopInstallers) && ((matrix.os == ''windows'')) }}'
- id: 'step-35'
name: 'Cleanup temp files'
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ jobs:
fail-fast: false
matrix:
id:
- 'windows'
- 'windows-self-hosted'
- 'windows-2019'
- 'macos-x64'
- 'macos-aarch64'
include:
Expand All @@ -76,9 +77,9 @@ jobs:
extraGradleArgs:
- '-Pani.android.abis=x86_64'
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DBoost_INCLUDE_DIR=C:/vcpkg/installed/x64-windows/include" "-Dorg.gradle.jvmargs=-Xmx6g" "-Dkotlin.daemon.jvm.options=-Xmx6g" "--parallel" "-Pani.android.abis=x86_64"'
id: 'windows'
id: 'windows-self-hosted'
installNativeDeps: false
name: 'Windows x86_64'
name: 'Windows 10 x86_64'
os: 'windows'
runTests: true
runsOn:
Expand All @@ -87,6 +88,24 @@ jobs:
- 'X64'
selfHosted: true
uploadApk: false
uploadDesktopInstallers: false
- arch: 'x64'
buildAnitorrent: true
buildAnitorrentSeparately: false
buildIosFramework: false
composeResourceTriple: 'windows-x64'
extraGradleArgs:
- '-Pani.android.abis=x86_64'
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DBoost_INCLUDE_DIR=C:/vcpkg/installed/x64-windows/include" "-Dorg.gradle.jvmargs=-Xmx4g" "-Dkotlin.daemon.jvm.options=-Xmx4g" "--parallel" "-Pani.android.abis=x86_64"'
id: 'windows-2019'
installNativeDeps: true
name: 'Windows Server 2019 x86_64'
os: 'windows'
runTests: true
runsOn:
- 'windows-2019'
selfHosted: false
uploadApk: false
uploadDesktopInstallers: true
- arch: 'x64'
buildAnitorrent: true
Expand Down Expand Up @@ -342,7 +361,7 @@ jobs:
overwrite: 'true'
if: '${{ matrix.uploadApk }}'
- id: 'step-30'
name: 'Upload Android APK for Release'
name: 'π'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_REPOSITORY: '${{ secrets.GITHUB_REPOSITORY }}'
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/src.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ class MatrixInstance(

val matrixInstances = listOf(
MatrixInstance(
id = "windows",
name = "Windows x86_64",
id = "windows-self-hosted",
name = "Windows 10 x86_64",
runsOn = listOf("self-hosted", "Windows", "X64"),
os = OS.WINDOWS,
arch = Arch.X64,
Expand All @@ -240,6 +240,25 @@ val matrixInstances = listOf(
gradleHeap = "6g",
kotlinCompilerHeap = "6g",
gradleParallel = true,
uploadDesktopInstallers = false, // 只有 win server 2019 构建的包才能正常使用 anitorrent
extraGradleArgs = listOf(
"-Pani.android.abis=x86_64",
),
),
MatrixInstance(
id = "windows-2019",
name = "Windows Server 2019 x86_64",
runsOn = listOf("windows-2019"),
os = OS.WINDOWS,
arch = Arch.X64,
selfHosted = false,
uploadApk = false,
buildAnitorrent = true,
buildAnitorrentSeparately = false, // windows 单线程构建 anitorrent, 要一起跑节约时间
composeResourceTriple = "windows-x64",
gradleHeap = "4g",
kotlinCompilerHeap = "4g",
gradleParallel = true,
extraGradleArgs = listOf(
"-Pani.android.abis=x86_64",
),
Expand Down Expand Up @@ -780,6 +799,7 @@ fun JobBuilder<*>.uploadAnitorrent() {
action = UploadArtifact(
name = $"anitorrent-cmake-cache-${expr { matrix.os }}-${expr { matrix.arch }}",
path_Untyped = "torrent/anitorrent/build-ci/CMakeCache.txt",
overwrite = true,
),
)
uses(
Expand All @@ -788,6 +808,7 @@ fun JobBuilder<*>.uploadAnitorrent() {
action = UploadArtifact(
name = $"anitorrent-${expr { matrix.composeResourceTriple }}",
path_Untyped = "app/desktop/appResources/${expr { matrix.composeResourceTriple }}/anitorrent",
overwrite = true,
),
)
}
Expand Down Expand Up @@ -817,6 +838,7 @@ fun JobBuilder<*>.packageDesktopAndUpload() {
action = UploadArtifact(
name = "ani-macos-dmg-${expr { matrix.arch }}",
path_Untyped = "app/desktop/build/compose/binaries/main-release/dmg/Ani-*.dmg",
overwrite = true,
),
)
uses(
Expand All @@ -825,6 +847,7 @@ fun JobBuilder<*>.packageDesktopAndUpload() {
action = UploadArtifact(
name = "ani-windows-portable",
path_Untyped = "app/desktop/build/compose/binaries/main-release/app",
overwrite = true,
),
)
}
Expand Down

0 comments on commit 8282a4f

Please sign in to comment.