-
-
Notifications
You must be signed in to change notification settings - Fork 36
114 lines (109 loc) · 3.07 KB
/
ci.yml
File metadata and controls
114 lines (109 loc) · 3.07 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on:
push:
pull_request:
workflow_dispatch:
inputs:
force-build:
description: 'Force build'
required: false
type: boolean
force-docs:
description: 'Force docs'
required: false
type: boolean
permissions:
contents: read
pages: write
id-token: write
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
source: ${{ steps.changes.outputs.source }}
docs: ${{ steps.changes.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
source:
- 'Source/**'
- 'MultiFunPlayer.sln'
docs:
- 'Docs/**'
docs:
runs-on: ubuntu-latest
needs: [detect-changes]
if: ${{ (needs.detect-changes.outputs.docs == 'true') || (github.event.inputs.force-docs == 'true') }}
concurrency:
group: 'pages'
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 21
cache: npm
cache-dependency-path: ./Docs
- name: Install dependencies
run: npm ci
working-directory: ./Docs
- name: Build website
run: npm run build
working-directory: ./Docs
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./Docs/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
build:
runs-on: windows-latest
needs: [detect-changes]
if: ${{ (needs.detect-changes.outputs.source == 'true') || (github.event.inputs.force-build == 'true') }}
strategy:
matrix:
build_type: [Release, Debug]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'
- name: Determine version
id: gitversion
uses: gittools/actions/gitversion/execute@v1.1.1
- name: Install dependencies
run: dotnet restore
- name: Test ${{ matrix.build_type }}
run: dotnet test --configuration ${{ matrix.build_type }}
- name: Build ${{ matrix.build_type }}
run: dotnet publish --configuration ${{ matrix.build_type }}
- name: Upload ${{ matrix.build_type }} artifact
uses: actions/upload-artifact@v4
with:
name: MultiFunPlayer-${{ steps.gitversion.outputs.fullSemVer }}.${{ steps.gitversion.outputs.shortSha }}-${{ matrix.build_type }}
path: Source\MultiFunPlayer\bin\${{ matrix.build_type }}\win-x64\publish