@@ -3,43 +3,85 @@ name: Build
33on : [push]
44
55jobs :
6- unix- build :
7- name : Test on ${{ matrix.os }}
6+ build :
7+ name : Build on ${{ matrix.os }}
88 runs-on : ${{ matrix.os }}
99 strategy :
1010 matrix :
11- os : [ubuntu-latest, macOS-latest]
12-
11+ os : [ubuntu-latest, macOS-latest, windows-latest]
1312 steps :
14- - uses : actions/checkout@v1
13+ # Build Artifact
14+ - uses : actions/checkout@master
1515 - name : configure
16- run : cmake .
17- - name : make
16+ run : cmake .
17+ - if : startsWith(matrix.os,'ubuntu') || startsWith(matrix.os,'macOS')
18+ name : make
1819 run : make
20+ - if : startsWith(matrix.os,'windows')
21+ name : make
22+ run : cmake --build . --target ALL_BUILD --config Release -- /nologo /verbosity:minimal /maxcpucount
23+ # Rename Artifact
24+ - if : startsWith(matrix.os,'ubuntu')
25+ name : Rename binary
26+ run : mv bin/PassCoder2 bin/PassCoder2-linux-x86
27+ - if : startsWith(matrix.os, 'macOS')
28+ name : Rename binary
29+ run : mv bin/PassCoder2 bin/PassCoder2-macos-x86
30+ - if : startsWith(matrix.os, 'windows')
31+ name : Rename binary
32+ run : mv bin/Release/PassCoder2.exe bin/Release/PassCoder2-windows-x86.exe
33+ # Uploading Artifact
1934 - if : startsWith(matrix.os,'ubuntu')
2035 name : Upload binary
2136 uses : actions/upload-artifact@v2
2237 with :
2338 name : PassCoder2-linux-x86
24- path : bin/PassCoder2
39+ path : bin/PassCoder2-linux-x86
2540 - if : startsWith(matrix.os, 'macOS')
2641 name : Upload binary
2742 uses : actions/upload-artifact@v2
2843 with :
2944 name : PassCoder2-macos-x86
30- path : bin/PassCoder2
31- win-build :
32- name : Test on windows-latest
33- runs-on : windows-latest
34-
35- steps :
36- - uses : actions/checkout@v1
37- - name : configure
38- run : cmake .
39- - name : make
40- run : cmake --build . --target ALL_BUILD --config Release -- /nologo /verbosity:minimal /maxcpucount
41- - name : Upload binary
45+ path : bin/PassCoder2-macos-x86
46+ - if : startsWith(matrix.os, 'windows')
47+ name : Upload binary
4248 uses : actions/upload-artifact@v2
4349 with :
4450 name : PassCoder2-windows-x86
45- path : bin/Release/PassCoder2.exe
51+ path : bin/Release/PassCoder2-windows-x86.exe
52+
53+ release-upload :
54+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
55+ name : Upload artifact to Release
56+ needs : build
57+ runs-on : ubuntu-latest
58+ steps :
59+ - uses : actions/checkout@master
60+ - uses : actions/download-artifact@master
61+ name : Download Artifact Windows
62+ with :
63+ name : PassCoder2-windows-x86
64+ path : PassCoder2-windows-x86
65+ - uses : actions/download-artifact@master
66+ name : Download Artifact Linux
67+ with :
68+ name : PassCoder2-linux-x86
69+ path : PassCoder2-linux-x86
70+ - uses : actions/download-artifact@master
71+ name : Download Artifact MacOS
72+ with :
73+ name : PassCoder2-macos-x86
74+ path : PassCoder2-macos-x86
75+ - name : Create release
76+ uses : Roang-zero1/github-create-release-action@master
77+ env :
78+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79+ - name : Create GitHub release
80+ uses : Roang-zero1/github-upload-release-artifacts-action@master
81+ with :
82+ args :
83+ PassCoder2-windows-x86
84+ PassCoder2-linux-x86
85+ PassCoder2-macos-x86
86+ env :
87+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments