-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.yml
79 lines (68 loc) · 2.67 KB
/
main.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
on:
push:
branches:
- master
paths-ignore:
- '.git*'
- '.vscode'
- '.github/**/*.yml'
jobs:
build:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Navigate to Workspace
run: cd $GITHUB_WORKSPACE
- name: Get Assembly Version
id: getversion
uses: berglie/assembly-version/get@v1
with:
filename: Version.txt
directory: './DU-Industry-Tool'
- name: Restore Packages
run: nuget restore DU-Industry-Tool.sln
- name: Build Solution
run: |
msbuild.exe DU-Industry-Tool.sln /p:platform="Any CPU" /p:configuration="Release"
- name: Archive Release
if: ${{ (github.ref == 'refs/heads/master') }} # ONLY ON MASTER
uses: thedoctor0/zip-release@main
with:
directory: DU-Industry-Tool/bin/Release/
type: 'zip'
filename: DU-Industry-Tool-v${{ steps.getversion.outputs.version }}.zip
exclusions: '*.git* /*node_modules/* *.exe.config *.xml *.pdb *.vs* *.user .editorconfig'
- name: Create Github Release
if: ${{ (github.ref == 'refs/heads/master') }} # ONLY ON MASTER
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.getversion.outputs.version }}
release_name: DU-Industry-Tool-v${{ steps.getversion.outputs.version }}
draft: true
prerelease: false
body_path: latestchanges.md
- name: Upload release
if: ${{ (github.ref == 'refs/heads/master') }} # ONLY ON MASTER
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: DU-Industry-Tool/bin/Release/DU-Industry-Tool-v${{ steps.getversion.outputs.version }}.zip
asset_name: DU-Industry-Tool-v${{ steps.getversion.outputs.version }}.zip
asset_content_type: application/zip
- name: Publish release
if: ${{ (github.ref == 'refs/heads/master') }} # ONLY ON MASTER
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}