-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.63 KB
/
Copy pathwin-cbc.yml
File metadata and controls
60 lines (49 loc) · 1.63 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
name: Windows CBC Static Build
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build-cbc:
runs-on: windows-2022
env:
TRIPLET: x64-windows-static
VCPKG_ROOT: C:\vcpkg-custom
CBC_TAG: cbc-windows-static
CBC_ZIP: cbc-windows-x64-static.zip
steps:
- name: Checkout (dummy)
uses: actions/checkout@v4
- name: Ensure clean vcpkg dir
shell: pwsh
run: |
if (Test-Path $env:VCPKG_ROOT) {
Write-Host "Removing existing $env:VCPKG_ROOT"
Remove-Item -Recurse -Force $env:VCPKG_ROOT
}
New-Item -ItemType Directory -Path $env:VCPKG_ROOT | Out-Null
- name: Clone vcpkg
shell: pwsh
run: git clone https://github.com/microsoft/vcpkg.git $env:VCPKG_ROOT
- name: Bootstrap vcpkg
shell: pwsh
run: |
& "$env:VCPKG_ROOT\bootstrap-vcpkg.bat" -disableMetrics
- name: Install CBC via vcpkg (static)
shell: pwsh
run: |
& "$env:VCPKG_ROOT\vcpkg.exe" install coin-or-cbc --triplet $env:TRIPLET
- name: Archive CBC installed tree
shell: pwsh
run: |
$source = "$env:VCPKG_ROOT\installed"
Write-Host "Zipping $source into $env:CBC_ZIP"
if (Test-Path $env:CBC_ZIP) { Remove-Item $env:CBC_ZIP -Force }
Compress-Archive -Path $source -DestinationPath $env:CBC_ZIP -Force
- name: Upload CBC zip to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
Write-Host "Uploading $env:CBC_ZIP to release tag $env:CBC_TAG"
gh release upload $env:CBC_TAG $env:CBC_ZIP --repo $env:GITHUB_REPOSITORY --clobber