1
+ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
1
2
name : Build
2
3
3
4
on :
4
5
push :
5
- branches : [ main ]
6
- tags : [ '*' ]
6
+ branches : [main]
7
+ tags : ["*" ]
7
8
pull_request :
8
- branches : [ main ]
9
+ branches : [main]
9
10
10
11
env :
11
12
DotNetVersion : " 6.0.x"
@@ -16,108 +17,114 @@ jobs:
16
17
build-windows :
17
18
runs-on : windows-latest
18
19
steps :
19
- - uses : actions/checkout@v2
20
+ - uses : actions/checkout@v2
20
21
21
- - uses : actions/setup-dotnet@v1
22
- with :
23
- dotnet-version : ${{ env.DotNetVersion }}
22
+ - uses : actions/setup-dotnet@v1
23
+ with :
24
+ dotnet-version : ${{ env.DotNetVersion }}
24
25
25
- - name : Build PabloDraw
26
- run : dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-windows.binlog
26
+ -
uses :
microsoft/[email protected]
27
27
28
- - name : Build PabloDraw.Console
29
- run : dotnet publish Source/PabloDraw.Console /PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console -windows.binlog
28
+ - name : Build PabloDraw
29
+ run : dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-windows.binlog
30
30
31
- - uses : actions/upload-artifact@v2
32
- with :
33
- name : pablodraw-windows-x64
34
- path : artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0-windows/win-x64/publish/*
35
-
36
- - uses : actions/upload-artifact@v2
37
- with :
38
- name : pablodraw-windows-x64
39
- path : artifacts/bin/PabloDraw.Console/x64/${{ env.BuildConfiguration }}/*
40
-
41
- - name : Upload log files
42
- if : ${{ failure() }}
43
- uses : actions/upload-artifact@v2
44
- with :
45
- name : log
46
- path : artifacts/log/**/*
31
+ - name : Build PabloDraw.Console
32
+ run : dotnet publish Source/PabloDraw.Console/PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-windows.binlog
33
+
34
+ - name : Build msi
35
+ run : msbuild ${{ env.BuildParameters }} Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj
36
+
37
+ - uses : actions/upload-artifact@v2
38
+ with :
39
+ name : pablodraw-windows-binaries-x64
40
+ path : artifacts/publish/${{ env.BuildConfiguration }}/Windows/*
41
+
42
+ - uses : actions/upload-artifact@v2
43
+ with :
44
+ name : pablodraw-windows-installer-x64
45
+ path : artifacts/installer/${{ env.BuildConfiguration }}/Windows/*.msi
46
+
47
+ - name : Upload log files
48
+ if : ${{ failure() }}
49
+ uses : actions/upload-artifact@v2
50
+ with :
51
+ name : log
52
+ path : artifacts/log/**/*
47
53
48
54
build-linux :
49
55
runs-on : ubuntu-latest
50
56
steps :
51
- - uses : actions/checkout@v2
57
+ - uses : actions/checkout@v2
52
58
53
- - uses : actions/setup-dotnet@v1
54
- with :
55
- dotnet-version : ${{ env.DotNetVersion }}
59
+ - uses : actions/setup-dotnet@v1
60
+ with :
61
+ dotnet-version : ${{ env.DotNetVersion }}
56
62
57
- - name : Build PabloDraw
58
- run : dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-linux.binlog
63
+ - name : Build PabloDraw
64
+ run : dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-linux.binlog
65
+
66
+ - name : Create gzip
67
+ run : tar -czvf pablodraw.tar.gz -C artifacts/publish/${{ env.BuildConfiguration }}/Linux .
59
68
60
- - uses : actions/upload-artifact@v2
61
- with :
62
- name : pablodraw-linux-x64
63
- path : artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/linux-x64/publish/*
69
+ - uses : actions/upload-artifact@v2
70
+ with :
71
+ name : pablodraw-linux-binaries -x64
72
+ path : pablodraw.tar.gz
64
73
65
- - name : Upload log files
66
- if : ${{ failure() }}
67
- uses : actions/upload-artifact@v2
68
- with :
69
- name : log
70
- path : artifacts/log/**/*
74
+ - name : Upload log files
75
+ if : ${{ failure() }}
76
+ uses : actions/upload-artifact@v2
77
+ with :
78
+ name : log
79
+ path : artifacts/log/**/*
71
80
72
81
build-mac :
73
82
runs-on : macos-11
74
83
steps :
75
- - uses : actions/checkout@v2
76
-
77
- - uses : actions/setup-dotnet@v1
78
- with :
79
- dotnet-version : ${{ env.DotNetVersion }}
80
-
81
- - uses : maxim-lobanov/setup-xamarin@v1
82
- with :
83
- mono-version : latest
84
- xamarin-mac-version : latest
85
- xcode-version : 13.1
86
-
87
- - name : Import code signing certificate
88
- if : github.event_name != 'pull_request'
89
- uses : apple-actions/import-codesign-certs@v1
90
- with :
91
- p12-file-base64 : ${{ secrets.DEVID_CERTIFICATE_P12 }}
92
- p12-password : ${{ secrets.DEVID_CERTIFICATE_P12_PASSWORD }}
93
-
94
- - name : Enable code signing
95
- if : github.event_name != 'pull_request'
96
- run : echo "BuildParameters=${{ env.BuildParameters }} /p:EnableCodeSigning=True" >> $GITHUB_ENV
97
-
98
- - name : Set notarization credentials
99
- if : startsWith(github.ref, 'refs/tags/')
100
- run : |
101
- xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.AC_USERNAME }}" -p "${{ secrets.AC_PASSWORD }}"
102
- echo "BuildParameters=${{ env.BuildParameters }} /p:EnableNotarization=True" >> $GITHUB_ENV
103
-
104
- - name : Build PabloDraw
105
- run : dotnet build Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-mac.binlog
106
-
107
- - uses : actions/upload-artifact@v2
108
- with :
109
- name : pablodraw-mac
110
- path : artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/PabloDraw.dmg
111
-
112
- - name : Upload log files
113
- if : ${{ failure() }}
114
- uses : actions/upload-artifact@v2
115
- with :
116
- name : log
117
- path : artifacts/log/**/*
118
-
84
+ - uses : actions/checkout@v2
85
+
86
+ - uses : actions/setup-dotnet@v1
87
+ with :
88
+ dotnet-version : ${{ env.DotNetVersion }}
89
+
90
+ - uses : maxim-lobanov/setup-xcode@v1
91
+ with :
92
+ xcode-version : 13.1
93
+
94
+ - name : Import code signing certificate
95
+ if : github.event_name != 'pull_request'
96
+ uses : apple-actions/import-codesign-certs@v1
97
+ with :
98
+ p12-file-base64 : ${{ secrets.DEVID_CERTIFICATE_P12 }}
99
+ p12-password : ${{ secrets.DEVID_CERTIFICATE_P12_PASSWORD }}
100
+
101
+ - name : Enable code signing
102
+ if : github.event_name != 'pull_request'
103
+ run : echo "BuildParameters=${{ env.BuildParameters }} /p:EnableCodeSigning=True" >> $GITHUB_ENV
104
+
105
+ - name : Set notarization credentials
106
+ if : startsWith(github.ref, 'refs/tags/')
107
+ run : |
108
+ xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.AC_USERNAME }}" -p "${{ secrets.AC_PASSWORD }}"
109
+ echo "BuildParameters=${{ env.BuildParameters }} /p:EnableNotarization=True" >> $GITHUB_ENV
110
+
111
+ - name : Build PabloDraw
112
+ run : dotnet build Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-mac.binlog
113
+
114
+ - uses : actions/upload-artifact@v2
115
+ with :
116
+ name : pablodraw-mac
117
+ path : artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/PabloDraw.dmg
118
+
119
+ - name : Upload log files
120
+ if : ${{ failure() }}
121
+ uses : actions/upload-artifact@v2
122
+ with :
123
+ name : log
124
+ path : artifacts/log/**/*
125
+
119
126
update-release :
120
- needs : [ build-windows, build-mac, build-linux ]
127
+ needs : [build-windows, build-mac, build-linux]
121
128
runs-on : ubuntu-latest
122
129
if : (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
123
130
steps :
@@ -128,14 +135,12 @@ jobs:
128
135
uses :
bruceadams/[email protected]
129
136
env :
130
137
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
131
-
138
+
132
139
- uses : actions/download-artifact@v2
133
140
134
- # - uses: actions/upload-release-asset@v1
135
- # env:
136
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137
- # with:
138
- # upload_url: ${{ steps.get_release.outputs.upload_url }}
139
- # asset_path:
140
- # asset_name:
141
- # asset_content_type: application/octet-stream
141
+ - uses : softprops/action-gh-release@v1
142
+ with :
143
+ files : |
144
+ **/*.msi
145
+ **/*.dmg
146
+ **/*.tar.gz
0 commit comments