-
Notifications
You must be signed in to change notification settings - Fork 43
78 lines (64 loc) · 1.69 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
name: Build
on:
push:
branches:
- "**"
pull_request:
workflow_dispatch:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.x
5.x
6.x
7.x
8.x
- name: Log dotnet info
run: dotnet --info
- name: Run test
run: ./build.ps1 --target=Test
build:
runs-on: windows-latest
if: github.ref == 'refs/heads/master'
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Make repo pushable
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_PAT: ${{ secrets.GITHUB_PAT }}
shell: bash
run: git remote set-url --push origin https://$GITHUB_USER:[email protected]/$GITHUB_REPOSITORY.git
- name: Run build script
run: ./build.ps1 --target=Build
- name: Create a release tag
if: github.ref == 'refs/heads/master'
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
run: ./build.ps1 --target=Publish --nugetKey="${env:NUGET_KEY}"
- name: Get target file
id: getfilename
shell: bash
run: |
echo "file=$(ls ./Harmony/bin/Release/HarmonyX*.nupkg)" >> "$GITHUB_OUTPUT"
- name: Upload HarmonyX nupkg
uses: actions/upload-artifact@v4
with:
name: HarmonyX
path: ${{ steps.getfilename.outputs.file }}