-
Notifications
You must be signed in to change notification settings - Fork 8
138 lines (120 loc) · 4.14 KB
/
vcpkg.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
name: Vcpkg CI
on: [push]
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Cache vcpkg
uses: actions/cache@v4
with:
path: |
${{github.workspace}}/vcpkg
!${{github.workspace}}/vcpkg/buildtrees
!${{github.workspace}}/vcpkg/packages
!${{github.workspace}}/vcpkg/downloads
${{ github.workspace }}/build/bin/Db*.solutions
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build autoconf automake autoconf-archive
cmake --version
ninja --version
gcc --version
g++ --version
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
env:
VCPKG_PYTHON3: $(which python3)
run: |
echo "VCPKG_PYTHON3=$VCPKG_PYTHON3" >> $GITHUB_ENV
brew update
brew install cmake ninja autoconf automake autoconf-archive
cmake --version
ninja --version
clang --version
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
- name: Setup MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 'c82f74667287d3dc386bce81e44964370c91a289'
vcpkgJsonGlob: '**/vcpkg.json'
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DOPENMIND_BUILD_TESTS=ON || cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DOPENMIND_BUILD_TESTS=ON
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Check
working-directory: ${{github.workspace}}/build
run: ctest . -j ${{steps.cpu-cores.outputs.count}} -E "ts" --rerun-failed --output-on-failure
- name: List runtime dependencies
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
ldd ./install/bin/openmind
elif [ "$RUNNER_OS" == "macOS" ]; then
otool -L ./install/bin/openmind
fi
- name: Package
id: create_artifact
shell: bash
run: |
mkdir release
if [ "$RUNNER_OS" == "Windows" ]; then
ls ./install
7z a -r openmind.zip ./install/*
else
cd ./install
zip -r ./../openmind.zip *
cd ..
fi
name=openmind-${{ matrix.suffix }}-$(git describe --always).zip
mv -v ./openmind.zip release/${name}
echo "::set-output name=name::${name}"
echo "::set-output name=path::release/${name}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Release
path: release
- name: Create Changelog
id: create_changelog
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
last_tag=$(git describe --tags --abbrev=0 @^ || true)
if [ -z "$last_tag" ]; then
git log --oneline --format="%C(auto) %h %s" > changelog.txt
else
git log --oneline --format="%C(auto) %h %s" ${last_tag}..@ > changelog.txt
fi
cat changelog.txt
- name: Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
artifacts: ${{ steps.create_artifact.outputs.path }}
allowUpdates: true
artifactContentType: application/zip
bodyFile: changelog.txt
draft: false
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}