-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (90 loc) · 2.91 KB
/
Copy pathbuild.yml
File metadata and controls
93 lines (90 loc) · 2.91 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Build
on:
push:
branches: [main]
tags:
- '*'
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6.0.1
- name: Build
run: |
cmake -B ${{github.workspace}}/build -A x64
cmake --build ${{github.workspace}}/build --config Release
- name: Upload windows build
uses: actions/upload-artifact@v6.0.0
with:
name: windows
path: ${{github.workspace}}/build/Analyzers/Release/*.dll
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6.0.1
- name: Build
run: |
cmake -B ${{github.workspace}}/build/x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64
cmake --build ${{github.workspace}}/build/x86_64
cmake -B ${{github.workspace}}/build/arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64
cmake --build ${{github.workspace}}/build/arm64
- name: Upload MacOS x86_64 build
uses: actions/upload-artifact@v6.0.0
with:
name: macos_x86_64
path: |
${{github.workspace}}/build/x86_64/Analyzers/*.so
${{github.workspace}}/build/x86_64/Analyzers/*.dylib
- name: Upload MacOS arm64 build
uses: actions/upload-artifact@v6.0.0
with:
name: macos_arm64
path: |
${{github.workspace}}/build/arm64/Analyzers/*.so
${{github.workspace}}/build/arm64/Analyzers/*.dylib
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.1
- name: Build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build
- name: Upload Linux build
uses: actions/upload-artifact@v6.0.0
with:
name: linux
path: ${{github.workspace}}/build/Analyzers/*.so
publish:
needs: [windows, macos, linux]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: download individual builds
uses: actions/download-artifact@v8.0.1
with:
path: ${{github.workspace}}/artifacts
- name: zip
run: |
cd ${{github.workspace}}/artifacts
zip -r ${{github.workspace}}/analyzer.zip .
- uses: actions/upload-artifact@v6.0.0
with:
name: all-platforms
path: ${{github.workspace}}/artifacts/**
- name: create or update release
if: startsWith(github.ref, 'refs/tags/')
run: |
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
gh release upload "${GITHUB_REF_NAME}" "${GITHUB_WORKSPACE}/analyzer.zip" --repo "${GITHUB_REPOSITORY}" --clobber
else
gh release create "${GITHUB_REF_NAME}" "${GITHUB_WORKSPACE}/analyzer.zip" --repo "${GITHUB_REPOSITORY}" --generate-notes
fi
env:
GH_TOKEN: ${{ github.token }}