-
Notifications
You must be signed in to change notification settings - Fork 1
154 lines (123 loc) · 4.33 KB
/
release.yaml
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
153
154
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ${{ matrix.config.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
config:
- name: macOS
os: macos-latest
- name: Ubuntu
os: ubuntu-latest
- name: WebAssembly
os: ubuntu-latest
- name: Windows
os: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.conan2/p
C:/Users/runneradmin/.conan2/p
key: ${{ matrix.config.name }}-${{ hashFiles('**/conanfile.py') }}
restore-keys: |
${{ matrix.config.name }}-
- name: Prepare Build Directory
run: mkdir build
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Conan
run: pip install conan
- name: Detect Conan Profile
run: conan profile detect --force
- name: Set Conan Center
run: conan remote update conancenter --url https://center2.conan.io
- name: Detect WebAssembly Conan Profile
if: matrix.config.name == 'WebAssembly'
run: |
cat > ~/.conan2/profiles/webassembly <<EOF
include(default)
[settings]
arch=wasm
os=Emscripten
[tool_requires]
*: emsdk/3.1.72
EOF
- name: Install Conan
run: pip install conan
- name: Detect Conan Profile
run: conan profile detect --force
- name: Detect WebAssembly Conan Profile
if: matrix.config.name == 'WebAssembly'
run: |
cat > ~/.conan2/profiles/webassembly <<EOF
include(default)
[settings]
arch=wasm
os=Emscripten
[tool_requires]
*: emsdk/3.1.44
EOF
- name: Install Windows Or macOS Dependencies
if: matrix.config.name == 'Windows' || matrix.config.name == 'macOS'
run: conan install . --output-folder=build --build=missing --settings compiler.cppstd=20 --settings build_type=Release
- name: Install Ubuntu Dependencies
if: matrix.config.name == 'Ubuntu'
run: conan install . --output-folder=build --build=missing --settings compiler.cppstd=20 --settings build_type=Release --conf "tools.system.package_manager:mode=install" --conf "tools.system.package_manager:sudo=True"
- name: Install WebAssembly Dependencies
if: matrix.config.name == 'WebAssembly'
run: conan install . --output-folder=build --build=missing --profile=webassembly --settings compiler.cppstd=20 --settings build_type=Release
- name: Configure
run: cmake .. -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
working-directory: build
- name: Build
run: cmake --build . --parallel 4 --config Release --verbose
working-directory: build
- name: Create Artifacts Directory
run: mkdir artifacts
- name: Compress Artifacts
if: matrix.config.name == 'macOS'
working-directory: build
run: |
chmod -R a+rwx carimbo
tar -cpzvf macOS.tar.gz carimbo
mv macOS.tar.gz ../artifacts
- name: Compress Artifacts
if: matrix.config.name == 'Ubuntu'
working-directory: build
run: |
chmod +x carimbo
tar -czvf Ubuntu.tar.gz --mode='a+rwx' carimbo
mv Ubuntu.tar.gz ../artifacts
- name: Compress Artifacts
if: matrix.config.name == 'WebAssembly'
working-directory: build
run: |
zip -jr WebAssembly.zip carimbo.wasm carimbo.js
mv WebAssembly.zip ../artifacts
- name: Compress Artifacts
if: matrix.config.name == 'Windows'
working-directory: build
shell: powershell
run: |
Compress-Archive -LiteralPath 'Release/carimbo.exe' -DestinationPath "../artifacts/Windows.zip"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tagName }}
prerelease: ${{ github.events.inputs.prerelease }}
files: artifacts/*