-
-
Notifications
You must be signed in to change notification settings - Fork 61
66 lines (55 loc) · 1.92 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
on:
push:
branches:
- main
- dev
- release/*
workflow_dispatch:
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
submodules: true
- name: Prepare environment variables
run: |
echo "SHORT_SHA=$("${{ github.sha }}" | cut -c1-8)" >> $env:GITHUB_ENV
echo "APP_VERSION=$(((Get-Content loader\Version.cs) -Match '"(.+)"').Trim('"', ' '))" >> $env:GITHUB_ENV
- name: Update project files
run: |
(Get-Content loader\loader.csproj) -replace "FrameworkVersion>v4.5", "FrameworkVersion>v4.8" | Out-File loader\loader.csproj
(Get-Content loader\App.config) -replace "Version=v4.5", "Version=v4.8" | Out-File loader\App.config
(Get-Content loader\Version.cs) -replace 'CommitSha1.*;', 'CommitSha1 = "${{ env.SHORT_SHA }}";' | Out-File loader\Version.cs
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Build preload plugins
run: |
cd plugins
pnpm install
pnpm build
- name: Build solution
run: msbuild pengu-loader.sln /t:restore,build /m /p:Configuration=Release /p:Platform=x64
- name: Upload build outputs
uses: actions/upload-artifact@v3
with:
name: pengu-loader-v${{ env.APP_VERSION }}-beta-${{ env.SHORT_SHA }}
path: |
bin/*.exe
bin/*.dll