-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (60 loc) · 2.87 KB
/
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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build_and_release:
name: Build and release
runs-on: windows-latest
steps:
- name: Setup VS Dev Environment
uses: seanmiddleditch/gha-setup-vsdevenv@v4
- uses: actions/checkout@v2
- name: Restore packages
run: MSBuild.exe -t:restore -p:RestorePackagesConfig=true
# Visual studio, by default, does not support building of a setup project through the command line.
# So, we have to enable out of process builds by modifying a key in the registry or by running an
# application installed with the Visual Studio installer projects extension. For more details, visit
# the link: https://stackoverflow.com/questions/8648428/an-error-occurred-while-validating-hresult-8000000a
- name: Enable Out of process builds
run: |
$DisableOutOfProcessBuildPath = "$env:DevEnvDir" + "CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild"
if ($DisableOutOfProcessBuildPath | Test-Path) {
cd $DisableOutOfProcessBuildPath
.\DisableOutOfProcBuild.exe
}
- name: Build the solution
run: devenv.com .\MMPresenceProvider.sln /Build Release
- name: Sign the build with a code signing certificate
run: |
$bytes = [Convert]::FromBase64String("${{ secrets.CODE_SIGNING_CERT }}")
[IO.File]::WriteAllBytes("cert.pfx", $bytes)
$SignToolPath = $env:WindowsSdkVerBinPath + "x64\signtool.exe"
if ($SignToolPath | Test-Path) {
& $SignToolPath sign /f .\cert.pfx /fd SHA256 /d "Mattermost Presence Provider" .\MMPresenceProviderSetup\Setup.msi
& $SignToolPath sign /f .\cert.pfx /fd SHA256 /d "Mattermost Presence Provider" .\MMPresenceProviderSetup\setup.exe
}
- name: Remove files and create a zip of the build
run: |
if (Test-Path .\MMPresenceProviderSetup\MMPresenceProviderSetup.vdproj) { Remove-Item .\MMPresenceProviderSetup\MMPresenceProviderSetup.vdproj }
Compress-Archive -Path .\MMPresenceProviderSetup\ -DestinationPath MattermostPresenceProvider-${{ github.ref_name }}.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./MattermostPresenceProvider-${{ github.ref_name }}.zip
asset_name: MattermostPresenceProvider-${{ github.ref_name }}.zip
asset_content_type: application/gzip