-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (67 loc) · 2.21 KB
/
Copy pathbuild.yml
File metadata and controls
79 lines (67 loc) · 2.21 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
name: Build Release
on:
push:
tags:
- v*
workflow_dispatch:
permissions: write-all
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Get Conan
uses: turtlebrowser/get-conan@v1.2
- name: Cache Conan packages
id: cache-conan
uses: actions/cache@v3
with:
path: ~/.conan2
key: ${{ matrix.os }}-conan
- name: Configure Conan Profile
if: steps.cache-conan.outputs.cache-hit != 'true'
run: conan profile detect --force
- name: Configure Conan System Dependencies
if: steps.cache-conan.outputs.cache-hit != 'true' && matrix.os == 'ubuntu-latest'
run: |
echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf
- name: Install Visual Studio 16 2019
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1.1
with:
vs-version: '16.0'
msbuild-architecture: x64
- name: Compile
run: conan build . -s build_type=${{env.BUILD_TYPE}} ${{ matrix.os == 'windows-latest' && '-s compiler="msvc"' || ''}} -of build --build=missing
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: generator-${{ matrix.os }}
path: build/${{ matrix.os == 'windows-latest' && 'Release/generator.dll' || 'libgenerator.so'}}
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./generator-windows-latest/generator.dll
./generator-ubuntu-latest/libgenerator.so
draft: false
prerelease: false