-
Notifications
You must be signed in to change notification settings - Fork 6
152 lines (134 loc) · 6.02 KB
/
build.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build
on:
push:
branches:
- master
tags:
- "*"
pull_request:
schedule:
# Every week
- cron: "0 0 * * 0"
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-13, macos-14]
include:
- platform: ubuntu-latest
configure_preset: "static"
build_preset: "static-release"
release_name: "linux-x86-64"
cc: "gcc-14"
cxx: "g++-14"
- platform: windows-latest
configure_preset: "windows-static"
build_preset: "windows-static-release"
release_name: "windows-x64"
- platform: macos-13
configure_preset: "macos"
build_preset: "macos-release"
release_name: "macos-x64"
cc: "/usr/local/opt/llvm/bin/clang"
cxx: "/usr/local/opt/llvm/bin/clang++"
- platform: macos-14
configure_preset: "macos"
build_preset: "macos-release"
release_name: "macos-arm64"
cc: "/opt/homebrew/opt/llvm/bin/clang"
cxx: "/opt/homebrew/opt/llvm/bin/clang++"
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: lukka/get-cmake@latest
- name: Run vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: "vcpkg.json"
- name: Install requirements
run: |
# Temporary until gcc-14 is officialy released and available on the runner
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ noble main universe"
sudo apt update
sudo apt install gcc-14 g++-14
sudo apt install libfuse-dev
if: matrix.platform == 'ubuntu-latest'
- name: Brew python fix
run: |
# Temporary fix, see https://github.com/actions/setup-python/issues/577
rm /usr/local/bin/2to3 || true
rm /usr/local/bin/idle3 || true
rm /usr/local/bin/pydoc3 || true
rm /usr/local/bin/python3 || true
rm /usr/local/bin/python3-config || true
shell: bash
if: matrix.platform == 'macos-13'
- name: Install requirements (MacOS)
run: |
brew update
brew install llvm
brew install macfuse
# Hack to properly target the os libcxx dynlib
sed -i '' '/^#define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS/d' "$(brew --prefix llvm)"/include/c++/v1/__config_site
echo "CXXFLAGS=-mmacos-version-min=13.4" >> $GITHUB_ENV
shell: bash
if: matrix.platform == 'macos-13' || matrix.platform == 'macos-14'
- name: Set compiler
run: |
echo "CC=${{matrix.cc}}" >> $GITHUB_ENV
echo "CXX=${{matrix.cxx}}" >> $GITHUB_ENV
shell: bash
if: matrix.cc != ''
- name: Build
uses: lukka/run-cmake@v10
with:
configurePreset: ${{matrix.configure_preset}}
buildPreset: ${{matrix.build_preset}}
- name: Strip binaries
run: |
strip build/${{matrix.configure_preset}}/wfs-extract/Release/wfs-extract
strip build/${{matrix.configure_preset}}/wfs-file-injector/Release/wfs-file-injector
strip build/${{matrix.configure_preset}}/wfs-fuse/Release/wfs-fuse
strip build/${{matrix.configure_preset}}/wfs-info/Release/wfs-info
strip build/${{matrix.configure_preset}}/wfs-reencryptor/Release/wfs-reencryptor
shell: bash
if: matrix.platform != 'windows-latest'
- name: Upload wfs-extract
uses: actions/upload-artifact@v4
with:
name: wfs-extract-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-extract/Release
- name: Upload wfs-file-injector
uses: actions/upload-artifact@v4
with:
name: wfs-file-injector-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-file-injector/Release
- name: Upload wfs-fuse
uses: actions/upload-artifact@v4
with:
name: wfs-fuse-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-fuse/Release
if: matrix.platform != 'windows-latest'
- name: Upload wfs-info
uses: actions/upload-artifact@v4
with:
name: wfs-info-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-info/Release
- name: Upload wfs-reencryptor
uses: actions/upload-artifact@v4
with:
name: wfs-reencryptor-${{matrix.release_name}}
path: build/${{matrix.configure_preset}}/wfs-reencryptor/Release
- name: Prepare Release Windows
run: powershell Compress-Archive -Path build\${{matrix.configure_preset}}\wfs-file-injector\Release\wfs-file-injector.exe, build\${{matrix.configure_preset}}\wfs-extract\Release\wfs-extract.exe, build\${{matrix.configure_preset}}\wfs-info\Release\wfs-info.exe, build\${{matrix.configure_preset}}\wfs-reencryptor\Release\wfs-reencryptor.exe -DestinationPath wfs-tools-${{github.ref_name}}-${{matrix.release_name}}.zip
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && matrix.platform == 'windows-latest'
- name: Prepare Release Linux & MacOS
run: zip -r -j wfs-tools-${{github.ref_name}}-${{matrix.release_name}}.zip build/${{matrix.configure_preset}}/wfs-file-injector/Release/wfs-file-injector build/${{matrix.configure_preset}}/wfs-extract/Release/wfs-extract build/${{matrix.configure_preset}}/wfs-fuse/Release/wfs-fuse build/${{matrix.configure_preset}}/wfs-info/Release/wfs-info build/${{matrix.configure_preset}}/wfs-reencryptor/Release/wfs-reencryptor
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && matrix.platform != 'windows-latest'
- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
with:
files: wfs-tools-${{github.ref_name}}-${{matrix.release_name}}.zip