diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 79e150113..cbba42cb9 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -123,23 +123,17 @@ jobs: unzip -o *.zip && rm -v *.zip env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Install go-msi - run: choco install -y "go-msi" - name: Prepare PATH - shell: bash - run: | - echo "$WIX\\bin" >> $GITHUB_PATH - echo "C:\\Program Files\\go-msi" >> $GITHUB_PATH + uses: microsoft/setup-msbuild@v1.0.3 - name: Build MSI id: buildmsi shell: bash env: ZIP_FILE: ${{ steps.download_exe.outputs.zip }} run: | - mkdir -p build - msi="$(basename "$ZIP_FILE" ".zip").msi" - printf "::set-output name=msi::%s\n" "$msi" - go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version "${GITHUB_REF#refs/tags/}" + name="$(basename "$ZIP_FILE" ".zip")" + printf "::set-output name=msi::%s\n" "$name.msi" + msbuild .\build\windows\gh.wixproj /p:SourceDir="$PWD" /p:OutputName="$name" /p:ProductVersion="${GITHUB_REF#refs/tags/}" - name: Obtain signing cert id: obtain_cert env: diff --git a/build/windows/ConvertTo-Rtf.ps1 b/build/windows/ConvertTo-Rtf.ps1 new file mode 100644 index 000000000..401951cc8 --- /dev/null +++ b/build/windows/ConvertTo-Rtf.ps1 @@ -0,0 +1,24 @@ +[CmdletBinding()] +param ( + [Parameter(Mandatory=$true, Position=0)] + [string] $Path, + + [Parameter(Mandatory=$true, Position=1)] + [string] $OutFile, + + [Parameter()] + [ValidateNotNullOrEmpty()] + [string] $FontFamily = 'Arial' +) + +$rtf = "{\rtf1\ansi\deff0{\fonttbl{\f0\fcharset0 $FontFamily;}}\pard\sa200\sl200\slmult1\fs20`n" +foreach ($line in (Get-Content $Path)) { + if (!$line) { + $rtf += "\par`n" + } else { + $rtf += "$line`n" + } +} +$rtf += '}' + +$rtf | Set-Content $OutFile \ No newline at end of file diff --git a/build/windows/LICENSE.rtf b/build/windows/LICENSE.rtf new file mode 100644 index 000000000..185063f24 --- /dev/null +++ b/build/windows/LICENSE.rtf @@ -0,0 +1,23 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0\fcharset0 Arial;}}\pard\sa200\sl200\slmult1\fs20 +MIT License +\par +Copyright (c) 2019 GitHub Inc. +\par +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +\par +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +\par +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +} diff --git a/build/windows/gh.wixproj b/build/windows/gh.wixproj new file mode 100644 index 000000000..56a87fb66 --- /dev/null +++ b/build/windows/gh.wixproj @@ -0,0 +1,35 @@ + + + + Debug + x64 + 0.1.0 + $(MSBuildProjectName) + package + $(MSBuildProjectDirectory)\..\.. + $(RepoPath)\bin\$(Platform)\$(Configuration)\ + $(RepoPath)\bin\obj\$(Platform)\$(Configuration)\ + + $(DefineConstants); + ProductVersion=$(ProductVersion); + + false + $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets + + + + + + + + + + + + + + + + + + diff --git a/build/windows/gh.wxs b/build/windows/gh.wxs new file mode 100644 index 000000000..7d2f967d5 --- /dev/null +++ b/build/windows/gh.wxs @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wix.json b/wix.json deleted file mode 100644 index 6b2356ae3..000000000 --- a/wix.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "product": "GitHub CLI", - "company": "GitHub, Inc.", - "license": "LICENSE", - "upgrade-code": "7c0a5736-5b8e-4176-b350-613fa2d8a1b3", - "files": { - "guid": "6e6dcb19-3cf6-46d1-ac56-c6fb39485c9d", - "items": [ - "bin/gh.exe" - ] - }, - "env": { - "guid": "94faac3d-4478-431c-8497-fba55dcfb249", - "vars": [ - { - "name": "PATH", - "value": "[INSTALLDIR]", - "permanent": "yes", - "system": "no", - "action": "set", - "part": "last" - } - ] - }, - "shortcuts": {}, - "choco": { - "description": "Use GitHub from the CLI", - "project-url": "https://github.com/cli/cli", - "tags": "github cli git", - "license-url": "https://github.com/cli/cli/blob/trunk/LICENSE" - } -}