-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 3.05 KB
/
release.yml
File metadata and controls
98 lines (83 loc) · 3.05 KB
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
name: Release
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Install Versionize
run: dotnet tool install --global Versionize
- name: Setup git
run: |
git config --global user.email opencommissioning@spiratec.com
git config --global user.name "oc-bot"
- name: Versioning
id: versionize
run: versionize --exit-insignificant-commits
continue-on-error: true
- name: Get current version
if: steps.versionize.outcome == 'success'
run: |
$version = versionize inspect
echo "VERSION=v$version" >> $env:GITHUB_ENV
shell: pwsh
- name: Get current changelog
if: steps.versionize.outcome == 'success'
run: |
$changelog = versionize changelog
Set-Content -Path latest_changelog.md -Value $changelog
shell: pwsh
- name: Push changes to GitHub
if: steps.versionize.outcome == 'success'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Dotnet build
if: steps.versionize.outcome == 'success'
run: |
dotnet build OC.OfficeLite --configuration release --output ./Publish
dotnet build OC.OfficeLiteServer --configuration release --output ./Publish
- name: Install AzureSignTool
run: dotnet tool install --global azuresigntool
- name: Sign executable
if: steps.versionize.outcome == 'success'
run: |
azuresigntool sign `
-kvu ${{secrets.AZURE_KEY_VAULT}} `
-kvc ${{secrets.AZURE_CERT_NAME}} `
-kvt ${{secrets.AZURE_TENANT_ID}} `
-kvi ${{secrets.AZURE_CLIENT_ID}} `
-kvs ${{secrets.AZURE_CLIENT_SECRET}} `
-tr http://timestamp.globalsign.com/tsa/advanced `
-td sha256 `
./Publish/OC.OfficeLite.dll `
./Publish/OC.OfficeLiteServer.exe
- name: Zip signed artifacts
if: steps.versionize.outcome == 'success'
run: |
mkdir OC.OfficeLite
mv OC.OfficeLite.dll OC.OfficeLite/
mv Config.plugin OC.OfficeLite/
Compress-Archive -Path OC.OfficeLite -DestinationPath OC.OfficeLite_${{env.VERSION}}.zip
Compress-Archive -Path OC.OfficeLiteServer.exe -DestinationPath OC.OfficeLiteServer_${{env.VERSION}}.zip
shell: pwsh
working-directory: Publish
- name: Publish new release
if: steps.versionize.outcome == 'success'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{env.VERSION}} -t "Release ${{env.VERSION}}" -F latest_changelog.md
gh release upload ${{env.VERSION}} ./Publish/OC.OfficeLite_${{env.VERSION}}.zip
gh release upload ${{env.VERSION}} ./Publish/OC.OfficeLiteServer_${{env.VERSION}}.zip