-
Notifications
You must be signed in to change notification settings - Fork 62
128 lines (114 loc) · 4.81 KB
/
Copy pathmain.yml
File metadata and controls
128 lines (114 loc) · 4.81 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build DLL
on:
push:
pull_request:
release:
types: [published]
jobs:
build_dll:
strategy:
matrix:
include:
- platform: x64
os: windows-latest
triplet: x64-windows
runs-on: ${{ matrix.os }}
env:
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-cache
VCPKG_BINARY_SOURCES: 'clear;files,${{ github.workspace }}/vcpkg-cache,readwrite'
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}-release
VCPKG_TARGET_TRIPLET: ${{ matrix.triplet }}-release
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed/
DEPS_DIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.triplet }}
INST_DIR: ${{ github.workspace }}/install-prefix
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: "recursive"
- name: Append short commit sha to CFG_VERSION_NUM in config.h
shell: powershell
run: |
$file = 'config.h'
$short=$(git rev-parse --short HEAD)
(Get-Content $file -Raw) -replace '(#define\s+CFG_VERSION_NUM\s+"[^"]*)(")', "`$1-$short`$2" | Set-Content $file
- name: Prepare cache directory
shell: powershell
run: "mkdir -Force ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}"
- name: Cache vcpkg dependencies
uses: actions/cache@v6
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}-${{ github.run_id }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}-
vcpkg-${{ runner.os }}-
- name: Bootstrap vcpkg
shell: powershell
run: |
.\vcpkg\bootstrap-vcpkg.bat
- name: Obtain and run CMake
uses: threeal/cmake-action@v2.1.0
with:
source-dir: "."
build-dir: "build"
generator: "Visual Studio 18 2026"
options: CMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake CMAKE_INSTALL_PREFIX=${{ env.INST_DIR }} VCPKG_INSTALLED_DIR=${{ env.VCPKG_INSTALLED_DIR }} VCPKG_TARGET_TRIPLET=${{ env.VCPKG_TARGET_TRIPLET }}
run-build: false
- name: Build DLL
run: "cmake --build build --config Release -t INSTALL"
- name: Show DLL resources
run: |
$dll = "install-prefix\SimpleGraphic.dll"
Write-Host "DLL path: $dll"
if (Test-Path $dll) {
Write-Host "VersionInfo:"; (Get-Item $dll).VersionInfo | Format-List
} else { Write-Host "DLL not found" }
- name: Archive DLL
uses: actions/upload-artifact@v7
with:
name: SimpleGraphic-${{ matrix.triplet }}.dll
path: "${{ env.INST_DIR }}/SimpleGraphic.dll"
- name: Archive DLL symbols
uses: actions/upload-artifact@v7
with:
name: SimpleGraphic-${{ matrix.triplet }}.pdb
path: "${{ github.workspace }}/build/Release/SimpleGraphic.pdb"
- name: Archive dependency DLLs
uses: actions/upload-artifact@v7
with:
name: SimpleGraphic-${{ matrix.triplet }}-deps.dll
path: |
${{ env.INST_DIR }}/*.dll
!${{ env.INST_DIR }}/SimpleGraphic.dll
- name: Archive dependency DLL symbols
uses: actions/upload-artifact@v7
with:
name: SimpleGraphic-${{ matrix.triplet }}-deps.pdb
path: |
${{ env.DEPS_DIR }}/bin/*.pdb
${{ github.workspace }}/build/Release/lzip.pdb
${{ github.workspace }}/build/Release/lcurl.pdb
- name: Upload to release
if: ${{ github.event_name == 'release' }}
run: |
cd ${{ env.INST_DIR }}
tar -cvf SimpleGraphicDLLs-${{ matrix.triplet }}.tar *.dll
gh release upload ${{ github.event.release.tag_name }} SimpleGraphicDLLs-${{ matrix.triplet }}.tar
- name: Notify PathOfBuilding repo
if: ${{ github.event_name == 'release' }}
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.WIRES77_PAT }}
repository: ${{ github.repository_owner }}/PathOfBuilding
event-type: update-simple-graphic
client-payload: '{"tag": "${{ github.event.release.tag_name }}", "release_link": "${{ github.event.release.html_url }}"}'
- name: Notify PathOfBuilding-PoE2 repo
if: ${{ github.event_name == 'release' }}
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.WIRES77_PAT }}
repository: ${{ github.repository_owner }}/PathOfBuilding-PoE2
event-type: update-simple-graphic
client-payload: '{"tag": "${{ github.event.release.tag_name }}", "release_link": "${{ github.event.release.html_url }}"}'