Skip to content

Commit

Permalink
Updates beta installer. Adds local build scripts (#671)
Browse files Browse the repository at this point in the history
* Updates build action to set beta installer version from the tag

* Adds comments to win installer files

* Adds local build and setup scripts
  • Loading branch information
waldekmastykarz authored Apr 23, 2024
1 parent 30b1c11 commit 14f1934
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ jobs:
- name: Add installer icon
if: contains(matrix.architecture, 'win-')
run: cp ./media/icon.ico ./${{ env.release }}
- name: Update version in beta installer
if: contains(matrix.architecture, 'win-') && contains('${{ github.ref_name }}', '-beta')
run: |
$content = Get-Content ./install-beta.iss
$content -replace '#define MyAppVersion .*', "#define MyAppVersion `"$("${{ github.ref_name }}".Substring(1))`"" | Set-Content ./install-beta.iss
- name: Set installer file name
id: installer
if: contains(matrix.architecture, 'win-')
Expand Down
1 change: 1 addition & 0 deletions install-beta.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Dev Proxy Beta"
; for local use only. In production replaced by a command line arg
#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.17.0-beta.4"
#define MyAppVersion "0.17.0-beta.4"
#define MyAppPublisher "Microsoft"
Expand Down
1 change: 1 addition & 0 deletions install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Dev Proxy"
; for local use only. In production replaced by a command line arg
#define MyAppSetupExeName "dev-proxy-installer-win-x64-0.17.0"
#define MyAppVersion "0.17.0"
#define MyAppPublisher "Microsoft"
Expand Down
15 changes: 15 additions & 0 deletions scripts/local-build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$versionString = "v0.17.0-beta.4"
$version = $versionString.Substring(1)

Remove-Item ../bld -Recurse -Force

dotnet publish ../dev-proxy/dev-proxy.csproj -c Release -p:PublishSingleFile=true -r win-x64 --self-contained -o ../bld -p:InformationalVersion=$version
dotnet build ../dev-proxy-plugins/dev-proxy-plugins.csproj -c Release -r win-x64 --no-self-contained -p:InformationalVersion=$version
cp -R ../dev-proxy/bin/Release/net8.0/win-x64/plugins ../bld
pushd

cd ../bld
Get-ChildItem -Filter *.pdb -Recurse | Remove-Item
Get-ChildItem -Filter *.deps.json -Recurse | Remove-Item
Get-ChildItem -Filter *.runtimeconfig.json -Recurse | Remove-Item
popd
33 changes: 33 additions & 0 deletions scripts/local-setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$versionString = "v0.17.0-beta.4"
$version = $versionString.Substring(1)
$isBeta = $version.Contains("-beta")

# Remove old installer if any
Get-Item ../bld/*installer* -ErrorAction SilentlyContinue | Remove-Item

if (-not (Test-Path ../bld)) {
Write-Error "Build directory not found. Run local-build.ps1 first."
exit 1
}

if ($isBeta) {
# Rename executable for beta
Rename-Item -Path ../bld/devproxy.exe -NewName devproxy-beta.exe
}

# Add installer icon
Copy-Item ../media/icon.ico ../bld/icon.ico

# Set installer filename
$installer = $isBeta ? "install-beta.iss" : "install.iss"

# Copy installer file
Copy-Item "../$installer" "../bld/$installer"

# Set version in installer script
if ($isBeta) {
(Get-Content "../bld/$installer") -replace "#define MyAppVersion .*", "#define MyAppVersion `"$version`"" | Set-Content "../bld/$installer"
}


ISCC.exe "../bld/$installer" /F"dev-proxy-installer-win-x64-$versionString"

0 comments on commit 14f1934

Please sign in to comment.