-
Notifications
You must be signed in to change notification settings - Fork 44
57 lines (48 loc) · 1.41 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
name: Build
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.300
- 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:
- uses: actions/checkout@v1
- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.300
- 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 "::set-output name=file::$(ls ./Harmony/bin/Release/HarmonyX*.nupkg)"
- uses: actions/upload-artifact@v1
with:
path: ${{ steps.getfilename.outputs.file }}
name: HarmonyX