-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (43 loc) · 1.31 KB
/
dotnet.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
variables:
runs-on: windows-latest
outputs:
build_number: ${{ steps.get_build_num.outputs.build_number }}
steps:
- name: Generating build number
uses: actions/github-script@v7
id: get_build_num
with:
script: |
core.setOutput('build_number', "${{ github.run_id }}".substr(-4, 4));
build:
needs: [variables]
runs-on: windows-latest
env:
solution_path: build\CounterStrike2GSI.sln
build_path: build\binaries\Release\
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Generate project
run: cmake -B build/ -A x64 -D BUILD_NUMBER=${{ needs.variables.outputs.build_number }} .
- name: Restore dependencies
run: dotnet restore $env:solution_path
- name: Build
run: dotnet build $env:solution_path --no-restore -c Release
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ${{ env.build_path }}