Skip to content

Commit 14f1934

Browse files
Updates beta installer. Adds local build scripts (#671)
* Updates build action to set beta installer version from the tag * Adds comments to win installer files * Adds local build and setup scripts
1 parent 30b1c11 commit 14f1934

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

.github/workflows/create-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ jobs:
7777
- name: Add installer icon
7878
if: contains(matrix.architecture, 'win-')
7979
run: cp ./media/icon.ico ./${{ env.release }}
80+
- name: Update version in beta installer
81+
if: contains(matrix.architecture, 'win-') && contains('${{ github.ref_name }}', '-beta')
82+
run: |
83+
$content = Get-Content ./install-beta.iss
84+
$content -replace '#define MyAppVersion .*', "#define MyAppVersion `"$("${{ github.ref_name }}".Substring(1))`"" | Set-Content ./install-beta.iss
8085
- name: Set installer file name
8186
id: installer
8287
if: contains(matrix.architecture, 'win-')

install-beta.iss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "Dev Proxy Beta"
5+
; for local use only. In production replaced by a command line arg
56
#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.17.0-beta.4"
67
#define MyAppVersion "0.17.0-beta.4"
78
#define MyAppPublisher "Microsoft"

install.iss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "Dev Proxy"
5+
; for local use only. In production replaced by a command line arg
56
#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.17.0"
67
#define MyAppVersion "0.17.0"
78
#define MyAppPublisher "Microsoft"

scripts/local-build.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$versionString = "v0.17.0-beta.4"
2+
$version = $versionString.Substring(1)
3+
4+
Remove-Item ../bld -Recurse -Force
5+
6+
dotnet publish ../dev-proxy/dev-proxy.csproj -c Release -p:PublishSingleFile=true -r win-x64 --self-contained -o ../bld -p:InformationalVersion=$version
7+
dotnet build ../dev-proxy-plugins/dev-proxy-plugins.csproj -c Release -r win-x64 --no-self-contained -p:InformationalVersion=$version
8+
cp -R ../dev-proxy/bin/Release/net8.0/win-x64/plugins ../bld
9+
pushd
10+
11+
cd ../bld
12+
Get-ChildItem -Filter *.pdb -Recurse | Remove-Item
13+
Get-ChildItem -Filter *.deps.json -Recurse | Remove-Item
14+
Get-ChildItem -Filter *.runtimeconfig.json -Recurse | Remove-Item
15+
popd

scripts/local-setup.ps1

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
$versionString = "v0.17.0-beta.4"
2+
$version = $versionString.Substring(1)
3+
$isBeta = $version.Contains("-beta")
4+
5+
# Remove old installer if any
6+
Get-Item ../bld/*installer* -ErrorAction SilentlyContinue | Remove-Item
7+
8+
if (-not (Test-Path ../bld)) {
9+
Write-Error "Build directory not found. Run local-build.ps1 first."
10+
exit 1
11+
}
12+
13+
if ($isBeta) {
14+
# Rename executable for beta
15+
Rename-Item -Path ../bld/devproxy.exe -NewName devproxy-beta.exe
16+
}
17+
18+
# Add installer icon
19+
Copy-Item ../media/icon.ico ../bld/icon.ico
20+
21+
# Set installer filename
22+
$installer = $isBeta ? "install-beta.iss" : "install.iss"
23+
24+
# Copy installer file
25+
Copy-Item "../$installer" "../bld/$installer"
26+
27+
# Set version in installer script
28+
if ($isBeta) {
29+
(Get-Content "../bld/$installer") -replace "#define MyAppVersion .*", "#define MyAppVersion `"$version`"" | Set-Content "../bld/$installer"
30+
}
31+
32+
33+
ISCC.exe "../bld/$installer" /F"dev-proxy-installer-win-x64-$versionString"

0 commit comments

Comments
 (0)