-
Notifications
You must be signed in to change notification settings - Fork 63
76 lines (70 loc) · 2.19 KB
/
build.yaml
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
name: build
on:
workflow_call:
secrets:
BINARY_ARCHIVE_DEPLOY_KEY:
description: Deploy key to read from the binary archive repository.
required: true
inputs:
ref:
description: The ref to checkout.
required: true
type: string
upload-artifact:
description: Whether artifacts should be uploaded.
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [windows, macos, linux]
archive-ref: [main]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Read Versions
run: |
HKV=$(cat ./hollowknight.version)
echo "HK_VERSION=$HKV" >> $GITHUB_ENV
- name: Checkout Binaries
uses: actions/checkout@v4
with:
repository: hk-modding/hk-binary-archives
ref: ${{ matrix.archive-ref }}
ssh-key: ${{ secrets.BINARY_ARCHIVE_DEPLOY_KEY }}
sparse-checkout: |
${{ env.HK_VERSION }}/managed.${{ matrix.platform }}.tar.gz
sparse-checkout-cone-mode: false
path: ./hk-binary-archives
persist-credentials: false
- name: Unpack Archive
run: |
mkdir Vanilla
cd ./Vanilla
tar -xzf ../hk-binary-archives/${{ env.HK_VERSION }}/managed.${{ matrix.platform }}.tar.gz
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Setup MSBuild
run: |
sudo apt-get update -y
sudo apt-get install -y nuget mono-devel mono-xbuild
- name: Restore Dependencies
run: |
dotnet restore
- name: Build PrePatcher
run: |
dotnet build PrePatcher -o PrePatcher/Output -p:Configuration=Release
- name: Build Assembly-CSharp
run: |
dotnet build Assembly-CSharp -p:SolutionDir=$PWD -p:Configuration=Release
- name: Upload Binary
if: inputs.upload-artifact
uses: actions/upload-artifact@v4
with:
name: build.${{ matrix.platform }}
path: ./OutputFinal/