forked from Scighost/Starward
-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (40 loc) · 1.49 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
name: Build
on:
push:
branches: [ "main", "dev/*" ]
pull_request:
branches: [ "main", "dev/*" ]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Debug, Release]
platform: [x64, arm64]
env:
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: SHA
id: sha
run: echo "sha=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_OUTPUT
- name: Build
run: |
$sha = "${{ steps.sha.outputs.sha }}"
New-Item -Path "build/Starward/" -Type Directory
msbuild src/Starward.Launcher "-property:Configuration=$env:Configuration;Platform=$env:Platform;OutDir=$(Resolve-Path "build/Starward/")"
dotnet publish src/Starward -c $env:Configuration -o "build/Starward/app-build.$sha" -p:Platform=$env:Platform -p:Version="0.0.1-build.$sha" -p:DefineConstants=CI -p:PublishTrimmed=true -p:TrimMode=partial
Add-Content "build/Starward/version.ini" -Value "app_folder=app-build.$sha`r`nexe_name=Starward.exe"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Starward_${{ matrix.configuration }}_${{ matrix.platform }}_${{ steps.sha.outputs.sha }}
path: build/Starward/