File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change 9090 mkdir -p artifacts/setup
9191 copy installer\Output\CleanMyPosts-Setup-${{ env.VERSION }}.exe artifacts\setup\
9292
93- - name : Generate update.xml
93+ - name : Generate update.xml from template
9494 shell : pwsh
9595 run : |
9696 $version = "${{ env.VERSION }}"
@@ -99,22 +99,17 @@ jobs:
9999 $installerUrl = "$baseUrl/CleanMyPosts-Setup-$version.exe"
100100 $changelogUrl = "https://github.com/$repo/releases/tag/v$version"
101101
102- $xmlContent = @"
103- <?xml version='1.0' encoding='utf-8'?>
104- <updates>
105- <application>
106- <name>CleanMyPosts</name>
107- <version>$version</version>
108- <url>$installerUrl</url>
109- <changelog>$changelogUrl</changelog>
110- </application>
111- </updates>
112- " @
102+ $template = Get-Content "update.xml" -Raw
103+ $xmlContent = $template `
104+ -replace "{{VERSION}}", $version `
105+ -replace "{{INSTALLER_URL}}", $installerUrl `
106+ -replace "{{CHANGELOG_URL}}", $changelogUrl
113107
108+ if (-not (Test-Path "artifacts")) {
109+ New-Item -ItemType Directory -Path "artifacts" | Out-Null
110+ }
114111 $xmlContent | Set-Content -Path "artifacts/update.xml" -Encoding UTF8
115112
116-
117-
118113 - name : Configure Git Credentials
119114 run : |
120115 echo "https://${{ secrets.GH_APIKEY }}@github.com" > $env:USERPROFILE\.git-credentials
You can’t perform that action at this time.
0 commit comments