-
Notifications
You must be signed in to change notification settings - Fork 14
129 lines (106 loc) · 3.66 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build
on:
push
env:
PLUGIN_REPO: WorkingRobot/MyDalamudPlugins
PROJECT_NAME: Craftimizer
IS_OFFICIAL: ${{true}}
jobs:
build:
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'
- name: Download Dalamud
run: |
wget https://goatcorp.github.io/dalamud-distrib/apiX/latest.zip
unzip latest.zip -d dalamud/
echo "DALAMUD_HOME=$PWD/dalamud" >> $GITHUB_ENV
- name: Restore
run: |
dotnet restore -r win
- name: Build
run: |
dotnet build --configuration Release --no-restore
- name: Test
run: |
dotnet test --configuration Release --logger "trx;logfilename=results.trx" --logger "html;logfilename=results.html" --logger "console;verbosity=detailed" --no-build --results-directory="TestResults"
- name: Create Unofficial Builds
if: ${{env.IS_OFFICIAL}}
run: python ./.github/create_unofficial.py ${{env.PROJECT_NAME}}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{env.PROJECT_NAME}}
path: ${{env.PROJECT_NAME}}/bin/x64/Release/${{env.PROJECT_NAME}}
if-no-files-found: error
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: TestResults
path: TestResults
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
id: release
with:
files: ${{env.PROJECT_NAME}}/bin/x64/Release/${{env.PROJECT_NAME}}/*
- name: Trigger Plugin Repo Update
uses: peter-evans/repository-dispatch@v2
if: ${{ steps.release.conclusion == 'success' }}
with:
token: ${{secrets.PAT}}
repository: ${{env.PLUGIN_REPO}}
event-type: new-release
bench:
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'
- name: Download Dalamud
run: |
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\"
- name: Restore
run: |
dotnet restore -r win
- name: Benchmark
run: |
dotnet run --configuration Release --project Benchmark -- -e json html github csv -f * -d -m
- name: Upload Test Results
uses: actions/upload-artifact@v4
with:
name: BenchmarkResults
path: BenchmarkDotNet.Artifacts
- name: Cache Benchmark Data
uses: actions/cache@v4
with:
path: ./bench-cache
key: ${{runner.os}}-${{ github.head_ref || github.ref_name }}-benchmark
- name: Publish Benchmarks
uses: rhysd/github-action-benchmark@v1
with:
tool: benchmarkdotnet
output-file-path: BenchmarkDotNet.Artifacts/results/Craftimizer.Benchmark.Bench-report-full-compressed.json
external-data-json-path: ./bench-cache/external.json
github-token: ${{secrets.GITHUB_TOKEN}}
comment-always: true
alert-threshold: '150%'
alert-comment-cc-users: '@${{github.actor}}'