-
Notifications
You must be signed in to change notification settings - Fork 13
142 lines (123 loc) · 5.73 KB
/
release_win_osx_linux.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
137
138
139
140
141
142
name: Build and release Windows & MacOS & Linux
on:
push:
tags:
- '*.*.*'
jobs:
build_win:
runs-on: windows-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v1
with:
sdk-version: 19041
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Restore NuGet Packages
run: nuget restore Atomex.Client.Desktop.sln
# - name: Create Code Signing Certificate
# run: |
# New-Item -ItemType directory -Path certificate
# Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WINDOWS_CERT_PFX_BASE64 }}'
# certutil -decode certificate\certificate.txt certificate\certificate.pfx
- name: Build Desktop app
run: dotnet publish Atomex.Client.Desktop.csproj -c Release -r win-x64
# - name: Sign builded artifacts
# run: |
# & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /f certificate\certificate.pfx /p '${{ secrets.WINDOWS_CERT_PFX_PASS }}' /t http://timestamp.comodoca.com/authenticode bin\Release\net5.0\win-x64\publish\Atomex.Client.Core.dll
# & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /f certificate\certificate.pfx /p '${{ secrets.WINDOWS_CERT_PFX_PASS }}' /t http://timestamp.comodoca.com/authenticode bin\Release\net5.0\win-x64\publish\Atomex.Client.Desktop.dll
# & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /f certificate\certificate.pfx /p '${{ secrets.WINDOWS_CERT_PFX_PASS }}' /t http://timestamp.comodoca.com/authenticode bin\Release\net5.0\win-x64\publish\Atomex.Client.Desktop.exe
- name: Build Desktop app .msi installer
run: MSBuild Atomex.Client.Desktop.Installer/Atomex.Client.Desktop.Installer.wixproj /p:Configuration=Release /p:RuntimeIdentifiers=win-x64 /clp:ErrorsOnly
# - name: Sign MSI installer
# run: |
# $version=(git describe --tags --abbrev=0)
# & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /f certificate\certificate.pfx /p '${{ secrets.WINDOWS_CERT_PFX_PASS }}' /t http://timestamp.comodoca.com/authenticode "Atomex.Client.Desktop.Installer\Installs\Atomex.Client-$version.0-x64.msi"
- name: Upload windows release artifacts
uses: actions/upload-artifact@v2
with:
name: atomex-win
path: Atomex.Client.Desktop.Installer/Installs
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.403
- name: Run Linux build script
env:
SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}
SPARKLE_PUBLIC_KEY: ${{ secrets.SPARKLE_PUBLIC_KEY }}
run: ./build_linux.sh
- name: Upload Linux release artifacts
uses: actions/upload-artifact@v2
with:
name: atomex-linux
path: dist/*
build_macos:
runs-on: macos-latest
needs: [ build_win, build_linux ]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
- name: Create keychain for codesign
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
MACOS_NOTARIZE_PWD: ${{ secrets.MACOS_NOTARIZE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $MACOS_CERTIFICATE_PWD atomex.build.keychain
security default-keychain -s atomex.build.keychain
security unlock-keychain -p $MACOS_CERTIFICATE_PWD atomex.build.keychain
security import certificate.p12 -k atomex.build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CERTIFICATE_PWD atomex.build.keychain
echo 'VER='$(xmllint --xpath "/*[local-name() = 'Project']/*[local-name() = 'PropertyGroup']/*[local-name() = 'Version']/text()" Atomex.Client.Desktop.csproj) >> $GITHUB_ENV
- name: Run Macos build bash script
env:
MACOS_NOTARIZE_PWD: ${{ secrets.MACOS_NOTARIZE_PWD }}
SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}
SPARKLE_PUBLIC_KEY: ${{ secrets.SPARKLE_PUBLIC_KEY }}
VER: ${{ env.VER }}
run: |
npm install --global create-dmg
./build_osx.sh $MACOS_NOTARIZE_PWD
- name: Download Windows articact files
uses: actions/download-artifact@v2
with:
name: atomex-win
path: dist/
- name: Create appcast file for Windows .msi installer
env:
SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}
SPARKLE_PUBLIC_KEY: ${{ secrets.SPARKLE_PUBLIC_KEY }}
VER: ${{ env.VER }}
run: ./create_msi_appcast.sh
- name: Download Linux release files
uses: actions/download-artifact@v2
with:
name: atomex-linux
path: dist/
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
files: dist/*