forked from ReClassNET/ReClass.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (53 loc) · 1.96 KB
/
Copy pathci.yml
File metadata and controls
66 lines (53 loc) · 1.96 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
name: build
on:
push:
branches:
- "**"
tags:
- "v*"
pull_request:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.0.x"
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Ensure BuildDate file
shell: pwsh
run: |
$path = "ReClass.NET/Resources/BuildDate.txt"
if (!(Test-Path $path)) {
New-Item -Force -ItemType Directory (Split-Path $path) | Out-Null
Get-Date -AsUTC -Format "yyyy/MM/dd HH:mm:ss" | Out-File $path
}
- name: Restore
run: msbuild ReClass.NET.sln /t:Restore
- name: Build x86
run: msbuild ReClass.NET.sln /p:Configuration=Release /p:Platform=x86 /restore
- name: Build x64
run: msbuild ReClass.NET.sln /p:Configuration=Release /p:Platform=x64 /restore
- name: Package release artifact
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$root = "$PWD"
$releaseRoot = Join-Path $root "bin/Release"
Get-ChildItem -Path $releaseRoot -Recurse -Include *.pdb, *.lib, *.exp | Remove-Item -Force
Remove-Item -Force "$releaseRoot/x86/ReClass.NET_Launcher.*" -ErrorAction SilentlyContinue
Remove-Item -Force "$releaseRoot/x64/ReClass.NET_Launcher.*" -ErrorAction SilentlyContinue
$zipPath = Join-Path $root "ReClass.NET-$env:GITHUB_REF_NAME.zip"
if (Test-Path $zipPath) { Remove-Item $zipPath -Force }
Compress-Archive -Path "$releaseRoot/*" -DestinationPath $zipPath
- name: Upload release artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: reclass-release
path: ReClass.NET-${{ github.ref_name }}.zip