-
Notifications
You must be signed in to change notification settings - Fork 52
74 lines (69 loc) · 2.14 KB
/
workflow.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
name: Workflow
on:
push:
branches:
- 'main'
- 'ci-*'
tags:
- 'v*'
pull_request:
jobs:
ci:
strategy:
matrix:
platform:
- { name: Linux, os: ubuntu-latest, arch: amd64, script: build-linux.sh }
- { name: MacOS, os: macos-latest, arch: amd64, script: build-macos.sh }
- { name: Windows, os: windows-latest, arch: amd64, script: build-msvc.ps1 }
- { name: Windows, os: windows-latest, arch: x86, script: build-msvc.ps1 }
runs-on: ${{ matrix.platform.os }}
name: CI (${{ matrix.platform.name }} ${{ matrix.platform.arch }})
steps:
- uses: actions/checkout@v3
- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.10.2
- uses: ilammy/[email protected]
if: runner.os == 'Windows'
with:
arch: ${{ matrix.platform.arch }}
- name: Build
id: build
run: .github/scripts/${{ matrix.platform.script }}
env:
PLATFORM_ARCH: ${{ matrix.platform.arch }}
- name: Test
run: |
cd build
ctest --verbose
- name: Upload Artifact
# if: startsWith(github.ref, 'refs/tags/') || github.ref_name == 'main'
uses: actions/upload-artifact@v3
with:
name: ${{ steps.build.outputs.filename }}
path: ${{ steps.build.outputs.filename }}
create-release:
name: Create Release
needs: [ci]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Fetch Build Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Calculate Variables
id: vars
run: |
echo "ref_name_without_v=$(echo ${GITHUB_REF_NAME} | cut -c2-)" >>$GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: softprops/[email protected]
with:
draft: false
prerelease: false
name: Dethrace ${{ steps.vars.outputs.ref_name_without_v }}
generate_release_notes: true
files: |
artifacts/**