-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (78 loc) · 2.88 KB
/
master.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
name: Image Sort CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ created ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
includePrerelease: true
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test .\tests\ImageSort.UnitTests\ImageSort.UnitTests.csproj --configuration Release --no-build
- name: Build WIX project
if: ${{ github.event_name == 'release' }}
env:
GITHUB_ACTIONS_CI: true
run: |
cd .\src\ImageSort.WindowsSetup\;
dotnet gitversion /updatewixversionfile | Out-String;
dotnet tool install --global wix
dotnet build -c Release -r win-x86 -p:Platform=x86
dotnet build -c Release -r win-x64 -p:Platform=x64
cd ..\..;
- name: Upload x86 MSI file
id: upload-x86-msi-file
uses: actions/[email protected]
if: ${{ github.event_name == 'release' }}
with:
asset_path: .\artifacts\x86\ImageSort.x86.msi
asset_name: ImageSort.x86.msi
asset_content_type: application/octet-stream
upload_url: ${{ github.event.release.upload_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TIME: ${{ github.run_number }}
- name: Upload x64 MSI file
id: upload-x64-msi-file
uses: actions/[email protected]
if: ${{ github.event_name == 'release' }}
with:
asset_path: .\artifacts\x64\ImageSort.x64.msi
asset_name: ImageSort.x64.msi
asset_content_type: application/octet-stream
upload_url: ${{ github.event.release.upload_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TIME: ${{ github.run_number }}
- name: Install winget-create
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
run: choco install wingetcreate
- name: Install .NET 6
uses: actions/setup-dotnet@v3
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
with:
dotnet-version: '6.0.x'
- name: Update and submit Winget manifest
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }}
run: |
wingetcreate.exe update --submit --token ${{ secrets.PAT_WINGET }} --urls "${{ steps.upload-x86-msi-file.outputs.browser_download_url }}" "${{ steps.upload-x64-msi-file.outputs.browser_download_url }}" --version "${{ steps.gitversion.outputs.assemblySemVer }}" Lolle2000la.ImageSort