-
Notifications
You must be signed in to change notification settings - Fork 159
126 lines (111 loc) · 4.14 KB
/
build.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
name: Build
on:
# push:
workflow_dispatch:
inputs:
net480:
description: Target .NET 4.8
type: boolean
default: false
release:
description: Release a distro
type: boolean
default: false
jobs:
build:
runs-on: windows-2019
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Prepare envars
run: |
echo "SHORT_SHA=$("${{ github.sha }}" | cut -c1-8)" >> $env:GITHUB_ENV
echo "APP_VERSION=$((Get-Content -Path "app\Program.cs" | Select-String -Pattern 'AppVersion\s=\s"(.+)"' -AllMatches).Matches.Groups[1].Value)" >> $env:GITHUB_ENV
- name: Target .NET 4.8
if: ${{ inputs.net480 }}
run: |
(Get-Content app\ParsecVDisplay.csproj) -replace "TargetFramework>net472", "TargetFramework>net480" | Out-File app\ParsecVDisplay.csproj
(Get-Content app\App.config) -replace "Version=v4.7.2", "Version=v4.8" | Out-File app\App.config
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Build app
run: |
cd app
msbuild ParsecVDisplay.csproj /t:Restore
msbuild ParsecVDisplay.csproj /t:Build /p:Configuration=Release /p:Platform=AnyCPU
echo "${{ env.APP_VERSION }}+${{ env.SHORT_SHA }}" >> bin\version
echo "ARTIFACT_NAME=ParsecVDisplay-v${{ env.APP_VERSION }}-${{ env.SHORT_SHA }}" >> $env:GITHUB_ENV
- name: Upload build output
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
app/bin/version
app/bin/vdd.cmd
app/bin/ParsecVDisplay.exe
app/bin/ParsecVDisplay.exe.config
- name: Sign the build
if: ${{ inputs.release }}
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORG_ID }}
project-slug: parsec-vdd
signing-policy-slug: release-signing
artifact-configuration-slug: zipped-exe
github-artifact-id: "${{steps.artifact-upload-step.outputs.artifact-id}}"
wait-for-completion: true
output-artifact-directory: bin
parameters: |
Version: "${{ github.ref_name }}"
- name: Fetch distro branch
if: ${{ inputs.release }}
uses: actions/checkout@v4
with:
ref: distro
fetch-depth: 0
path: distro
- name: Make setup installer & portable app
if: ${{ inputs.release }}
run: |
mkdir distro\final
Compress-Archive -Path bin\* -DestinationPath distro\final\ParsecVDisplay-v${{ env.APP_VERSION }}-portable.zip -Force
cd distro
& "$env:ProgramFiles (x86)\Inno Setup 6\iscc.exe" setup.iss
- name: Upload installer output
if: ${{ inputs.release }}
uses: actions/upload-artifact@v4
id: artifact-upload-installer-step
with:
name: setup-installer
path: |
distro/out/*.exe
- name: Sign the installer
if: ${{ inputs.release }}
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: ${{ secrets.SIGNPATH_ORG_ID }}
project-slug: parsec-vdd
signing-policy-slug: release-signing
artifact-configuration-slug: zipped-exe
github-artifact-id: "${{steps.artifact-upload-installer-step.outputs.artifact-id}}"
wait-for-completion: true
output-artifact-directory: distro/final
parameters: |
Version: "${{ github.ref_name }}"
- name: Delete unwanted artifacts
if: ${{ inputs.release }}
uses: geekyeggo/delete-artifact@v5
with:
name: '*'
- name: Upload signed output
if: ${{ inputs.release }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: distro/final/