-
-
Notifications
You must be signed in to change notification settings - Fork 24
111 lines (92 loc) · 3.38 KB
/
create-release.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
name: Create Release
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
platform: [x86, x64]
configuration: [Release]
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- uses: dotnet/nbgv@master
id: nbgv
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build with MSBuild
run: |
msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumber=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}}
- name: Create zip file
run: |
if ("${{ matrix.platform }}" -eq "x64"){
Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/
} else {
Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/
}
cd ./deploy
7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip *
- name: Upload artifacts
uses: actions/[email protected]
with:
name: Build ${{ matrix.platform }} artifacts
path: |
jN_*.zip
${{ matrix.configuration }}/*.dll
${{ matrix.configuration }}/*.pdb
${{ matrix.platform }}/${{ matrix.configuration }}/*.dll
${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb
retention-days: 3
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- uses: dotnet/nbgv@master
id: nbgv
- name: Create Tag
run: git tag ${{ steps.nbgv.outputs.SemVer2 }}
- name: Push Tag
run: git push origin ${{ steps.nbgv.outputs.SemVer2 }}
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.nbgv.outputs.SemVer2 }}
release_name: ${{ steps.nbgv.outputs.SemVer2 }}
draft: true
prerelease: false
- name: Download artifacts
uses: actions/[email protected]
with:
name: Build x64 artifacts
- name: Upload x64
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip
asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip
asset_content_type: application/zip
- name: Download artifacts
uses: actions/[email protected]
with:
name: Build x86 artifacts
- name: Upload x86
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip
asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip
asset_content_type: application/zip