-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.46 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
name: Build
on:
push:
branches:
- main
- "release/*"
pull_request:
workflow_dispatch:
merge_group:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Enable Developer Command Prompt (Windows)
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Build (Windows)
if: startsWith(matrix.os, 'windows')
shell: pwsh
run: |
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release
ninja -C build
- name: Upload artifact (Windows)
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v4
with:
name: crashpad-handler.exe
path: build/bin/crashpad/crashpad-handler.exe
check-release:
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
outputs:
IS_TAGGED: ${{ steps.is-rel.outputs.IS_TAGGED }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we need the tags
- name: Check Release
id: is-rel
run: |
set +e;
git describe --exact-match --match 'v*' &> /dev/null;
echo "IS_TAGGED=$?" >> "$GITHUB_OUTPUT";
shell: bash
draft-release:
runs-on: ubuntu-latest
needs: [build, check-release]
if: ${{ needs.check-release.outputs.IS_TAGGED == '0' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we need the tags
- uses: actions/download-artifact@v4
with:
name: crashpad-handler.exe
path: build/
- name: Get Tag
id: get-tag
run: echo "VALUE=$(git describe --exact-match --match 'v*')" >> "$GITHUB_OUTPUT"
- name: Create release
uses: ncipollo/release-action@v1.14.0
with:
replacesArtifacts: true
allowUpdates: true
artifactErrorsFailBuild: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
draft: true
artifacts: "build/*"
name: ${{ steps.get-tag.outputs.VALUE }}
tag: ${{ steps.get-tag.outputs.VALUE }}