-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (61 loc) · 3.2 KB
/
Copy pathci.yml
File metadata and controls
81 lines (61 loc) · 3.2 KB
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
75
76
77
78
79
80
81
name: CI
on: [pull_request, push, workflow_dispatch]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Build
runs-on: windows-latest
env:
FBSDK_VERSION: 2025-03-07
SOL_FILE: foo_opensubsonic.sln
MSBUILD_CMD_X86: /maxcpucount /property:RestorePackagesConfig=true,Configuration=Release,Platform=Win32 /target:restore,build
MSBUILD_CMD_X64: /maxcpucount /property:RestorePackagesConfig=true,Configuration=Release,Platform=x64 /target:restore,build
MSBUILD_CMD_ARM64EC: /maxcpucount /property:RestorePackagesConfig=true,Configuration=Release,Platform=ARM64EC /target:restore,build
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Download and extract foobar2000 SDK
run: |
(New-Object System.Net.WebClient).DownloadFile("https://www.foobar2000.org/files/SDK-${{ env.FBSDK_VERSION }}.7z", "${{ runner.temp }}\fbsdk.7z")
7z x "${{ runner.temp }}\fbsdk.7z" -o"lib\foobar2000_sdk" > nul
- name: Patch SDK
run: |
(Get-Content "lib\foobar2000_sdk\foobar2000\helpers\foobar2000_sdk_helpers.vcxproj") `
| ForEach-Object { $_ -replace '\.\.\\packages\\wtl', '..\..\..\..\packages\wtl' } `
| Set-Content "lib\foobar2000_sdk\foobar2000\helpers\foobar2000_sdk_helpers.vcxproj"
- name: Download WTL and nlohmann/json
run: |
git clone https://git.code.sf.net/p/wtl/git lib\WTL
New-Item -ItemType Directory -Force -Path "lib\nlohmann"
(New-Object System.Net.WebClient).DownloadFile("https://github.com/nlohmann/json/releases/download/v3.12.0/json.hpp", "lib\nlohmann\json.hpp")
(New-Object System.Net.WebClient).DownloadFile("https://github.com/nlohmann/json/releases/download/v3.12.0/json_fwd.hpp", "lib\nlohmann\json_fwd.hpp")
- name: Setup devcmd
uses: ilammy/msvc-dev-cmd@v1
- name: Build x86
run: |
msbuild ${{ env.SOL_FILE }} ${{ env.MSBUILD_CMD_X86 }}
- name: Build x64
run: |
msbuild ${{ env.SOL_FILE }} ${{ env.MSBUILD_CMD_X64 }}
- name: Build ARM64EC
run: |
msbuild ${{ env.SOL_FILE }} ${{ env.MSBUILD_CMD_ARM64EC }}
- name: Prepare build artifacts
run: |
copy "Release\foo_opensubsonic.dll" "."
copy "x64\Release\foo_opensubsonic.dll" "x64"
New-Item -ItemType Directory -Force -Path "arm64ec"
copy "ARM64EC\Release\foo_opensubsonic.dll" "arm64ec"
7z a -tzip -mx9 "foo_opensubsonic.fb2k-component" "foo_opensubsonic.dll" "x64\foo_opensubsonic.dll" "arm64ec\foo_opensubsonic.dll"
$hash = (Get-FileHash -Algorithm SHA256 "foo_opensubsonic.fb2k-component").hash.ToString().toLower()
Write-Output "$hash *foo_opensubsonic.fb2k-component" > "foo_opensubsonic.fb2k-component.sha256"
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: foo_opensubsonic
path: |
foo_opensubsonic.fb2k-component
foo_opensubsonic.fb2k-component.sha256