-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 1.86 KB
/
build-and-release.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
name: Build and Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
include:
- os: windows-latest
triplet: x64-windows
build-script: .\vcpkg\bootstrap-vcpkg.bat
cmake-command: |
cmake -B ./build
cmake --build ./build --config Release
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
${{ matrix.build-script }}
- name: Install dependencies
run: |
./vcpkg/vcpkg install crow civetweb zlib --triplet=${{ matrix.triplet }}
- name: Configure and build
run: |
${{ matrix.cmake-command }}
- name: Package executable for Windows
run: |
mkdir -p release
cp ./*.exe release/ || echo "No executables found"
cp ./*.dll release/ || echo "No DLLs found"
cp -r libs/ release/ || echo "No libs directory found"
# Use PowerShell's Compress-Archive for zipping files on Windows
powershell Compress-Archive -Path release/* -DestinationPath windows_release.zip
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: windows-build
path: windows_release.zip
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Windows build artifact
uses: actions/download-artifact@v3
with:
name: windows-build
path: .
- name: List downloaded files (Debugging step)
run: ls -al
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: windows_release.zip
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}