-
Notifications
You must be signed in to change notification settings - Fork 13
89 lines (74 loc) · 2.43 KB
/
main.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
77
78
79
80
81
82
83
84
85
86
87
88
89
name: main
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
build-net:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Create Build Directory
run: mkdir dist-net,dist-netcore
- name: Restore packages
run: |
msbuild.exe -t:restore -p:RestorePackagesConfig=true
- name: Build .Net version
run: |
msbuild.exe SourcetrailDotnetIndexer.sln /t:SourcetrailDotnetIndexer /nologo /p:platform="x64" /p:configuration="Release" /p:OutputPath="..\dist-net"
- name: Build .Net Core version
run: dotnet publish SourcetrailDotnetCoreIndexer\SourcetrailDotnetCoreIndexer.csproj -c Release -o "dist-netcore" -r win-x64 --nologo --self-contained false
- name: Packing .Net artifact
run: |
7z a SourcetrailDotnetIndexer-win-x64.zip .\dist-net\*
- name: Packing .Net Core artifact
run: |
7z a SourcetrailDotnetCoreIndexer-win-x64.zip .\dist-netcore\*
- name: Uploading artifacts
uses: actions/upload-artifact@v2
with:
name: BUILD
path: ./*-win-x64.zip
release:
runs-on: ubuntu-latest
needs: build-net
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Create github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
draft: ${{ !startsWith(github.ref, 'refs/tags/v') }}
prerelease: false
- uses: actions/download-artifact@v2
id: download
with:
name: BUILD
path: ./BUILD
- name: 'Echo download path'
if: env.ACTIONS_STEP_DEBUG
run: echo ${{steps.download.outputs.download-path}}
- name: Uploading artifacts to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ${{ steps.download.outputs.download-path }}
release_id: ${{ steps.create_release.outputs.id }}
overwrite: true
verbose: env.ACTIONS_STEP_DEBUG