1
+ on :
2
+ push :
3
+ # Sequence of patterns matched against refs/tags
4
+ tags :
5
+ - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6
+
7
+ name : Upload Release Asset - Windows
8
+
9
+ jobs :
10
+ build :
11
+ name : Upload Release Asset - Windows
12
+ runs-on : windows-latest
13
+ strategy :
14
+ matrix :
15
+ configuration : ['Release']
16
+ platform : ['Win32', 'x64']
17
+ steps :
18
+ - uses : actions/checkout@v2.3.4
19
+ with :
20
+ submodules : ' true'
21
+ fetch-depth : ' 0'
22
+ - name : setup-msbuild
23
+ uses : microsoft/setup-msbuild@v1
24
+ - name : premake
25
+ run :
26
+ .\premake.bat vs2017
27
+ - name : build
28
+ run : |
29
+ MSBuild.exe slang.sln -v:m -m -property:Configuration=${{matrix.configuration}} -property:Platform=${{matrix.platform}} -property:WindowsTargetPlatformVersion=10.0.19041.0
30
+ if (${{matrix.platform}} -eq "x64")
31
+ {
32
+ $slangDeployPlatform = "win64"
33
+ }
34
+ else
35
+ {
36
+ $slangDeployPlatform = "win32"
37
+ }
38
+ $tagName = & git describe --tags
39
+ $slangVersion = $tagName.TrimStart("v")
40
+ $binArchive = "slang-$slangVersion-$slangDeployPlatform.zip"
41
+ "::set-output name=SLANG_BINARY_ARCHIVE::$binArchive"
42
+
43
+ 7z a "$binArchive" slang.h
44
+ 7z a "$binArchive" slang-com-helper.h
45
+ 7z a "$binArchive" slang-com-ptr.h
46
+ 7z a "$binArchive" slang-tag-version.h
47
+ 7z a "$binArchive" prelude\*.h
48
+ 7z a "$binArchive" bin\*\*\slang.dll
49
+ 7z a "$binArchive" bin\*\*\slang.lib
50
+ 7z a "$binArchive" bin\*\*\slang-glslang.dll
51
+ 7z a "$binArchive" bin\*\*\slangc.exe
52
+ 7z a "$binArchive" docs\*.md
53
+
54
+ $srcArchive = "slang-$slangVersion-source.zip"
55
+ "::set-output name=SLANG_SOURCE_ARCHIVE::$srcArchive"
56
+
57
+ 7z a "$srcArchive" slang.h
58
+ 7z a "$srcArchive" slang-com-helper.h
59
+ 7z a "$srcArchive" slang-com-ptr.h
60
+ 7z a "$srcArchive" slang-tag-version.h
61
+ 7z a "$srcArchive" prelude\*.h
62
+ 7z a "$srcArchive" source\*\*.h
63
+ 7z a "$srcArchive" source\*\*.cpp
64
+ 7z a "$srcArchive" docs\*.md
65
+ 7z a "$srcArchive" README.md
66
+ 7z a "$srcArchive" LICENSE
67
+ - name : Create Release
68
+ id : create_release
69
+ uses : actions/create-release@v1
70
+ env :
71
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72
+ with :
73
+ tag_name : ${{ github.ref }}
74
+ release_name : Release ${{ github.ref }}
75
+ draft : false
76
+ prerelease : false
77
+ - name : Upload Release Asset (zip)
78
+ id : upload-release-asset-zip
79
+ uses : actions/upload-release-asset@v1
80
+ env :
81
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
82
+ with :
83
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
84
+ asset_path : ./${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }}
85
+ asset_name : ${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }}
86
+ asset_content_type : application/zip
87
+ - name : Upload Release Source (zip)
88
+ id : upload-release-src-zip
89
+ uses : actions/upload-release-asset@v1
90
+ if : ${{ matrix.platform == 'x64' }}
91
+ env :
92
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
93
+ with :
94
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
95
+ asset_path : ./${{ steps.build.outputs.SLANG_SOURCE_ARCHIVE }}
96
+ asset_name : ${{ steps.build.outputs.SLANG_SOURCE_ARCHIVE }}
97
+ asset_content_type : application/zip
0 commit comments