-
Notifications
You must be signed in to change notification settings - Fork 39
139 lines (111 loc) · 3.82 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
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
130
131
132
133
134
135
136
name: Build on Github servers
on:
push:
pull_request:
jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: .
outputs:
semver: ${{ steps.gitversion.outputs.semver }}
sourcegrid: ${{ steps.packageBuildResults.outputs.sourcegrid }}
nupkg-sourcegrid: ${{ steps.createNupkg.outputs.nupkg-sourcegrid }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup msbuild
uses: microsoft/[email protected]
with:
vs-version: '12.0'
- name: Restore Packages
run: Nuget restore SourceGrid_2013.sln
- name: Build
run: msbuild -m -t:Rebuild /p:Configuration=Release /p:Platform="Any CPU" /fl SourceGrid_2013.sln
- name: Archive Build Log
uses: actions/upload-artifact@v2
if: ${{ success() || failure() }}
with:
name: Compile_Solution_log
path: |
*.log
- name: Create zip
id: packageBuildResults
run: |
$sourceFolder = Join-Path $env:GITHUB_WORKSPACE "out" | Join-Path -ChildPath "*"
$outFolder = Join-Path $env:GITHUB_WORKSPACE "out" | Join-Path -ChildPath "sourcegrid"
New-Item -ItemType Directory -Force -Path $outFolder
$fileName = "sourcegrid-1.0.0.zip"
Write-Host "Filename: '$fileName'"
Write-Host "sourceFolder: '$sourceFolder'"
Write-Host "Outfolder: '$outFolder'"
Write-Host "::set-output name=sourcegrid::$($fileName)"
$outPath = Join-Path $outFolder $fileName
Compress-Archive -DestinationPath $outPath -Path $sourceFolder -CompressionLevel Optimal
- name: Archive Build Output
uses: actions/upload-artifact@v2
with:
name: sourcegrid
path: |
out/sourcegrid
- name: Create Nuget Packages
id: createNupkg
run: |
nuget pack SourceGrid.nuspec -Version 1.0.0
Write-Host "::set-output name=nupkg-sourcegrid::TEST.1.0.0.nupkg"
- name: Archive NuGet Packages
uses: actions/upload-artifact@v2
with:
name: nuget-TEST
path: |
*.nupkg
release:
if: github.ref == 'refs/heads/Github_runner'
runs-on: windows-latest
needs: build
steps:
- name: Download Build Output
uses: actions/download-artifact@v2
with:
name: sourcegrid
- name: Download NuGet Package
uses: actions/download-artifact@v2
with:
name: nuget-TEST
- name: Debug
run: |
tree
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.0.0
#tag_name: ${{ needs.build.outputs.semver }}
release_name: Release v1.0.0
body: |
${{ github.event.head_commit.message }}
draft: true
prerelease: false
- name: Upload Zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ needs.build.outputs.sourcegrid }}
asset_name: ${{ needs.build.outputs.sourcegrid }}
asset_content_type: application/zip
- name: Upload Nupkg
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ needs.build.outputs.nupkg-sourcegrid }}
asset_name: ${{ needs.build.outputs.nupkg-sourcegrid }}
asset_content_type: application/zip