-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (54 loc) · 2 KB
/
dotnet.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
name: .NET Build + Publish
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -p:PostBuildEvent=
- name: Publish Windows 64bit
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --os win --arch x64 -c Release --self-contained false MSUScripter/MSUScripter.csproj
- name: Publish Windows 32bit
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --os win --arch x86 -c Release --self-contained false MSUScripter/MSUScripter.csproj
- name: Publish Linux 64bit
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --os linux --arch x64 -c Release --self-contained false MSUScripter/MSUScripter.csproj
- name: Get version number
if: ${{ github.event_name != 'pull_request' }}
id: version
run: |
$version = (Get-Item "MSUScripter\bin\Release\net8.0\win-x86\publish\MSUScripter.exe").VersionInfo.ProductVersion
$version = $version.Split("+")[0]
Write-Host $version
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Building the Windows installer
if: ${{ github.event_name != 'pull_request' }}
run: "\"%programfiles(x86)%/Inno Setup 6/iscc.exe\" \"setup/MSUScripter.iss\""
shell: cmd
- name: Building the Linux 64bit package
if: ${{ github.event_name != 'pull_request' }}
working-directory: setup
run: "./LinuxBuildZipper.ps1"
shell: pwsh
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "setup/Output/*"
name: MSUScripter_${{ steps.version.outputs.number }}