Skip to content

Commit

Permalink
Generate MSI (#112)
Browse files Browse the repository at this point in the history
* Generate MSI

* 0.18.0-alpha
  • Loading branch information
baksetercx authored Nov 19, 2024
1 parent 30cd0b2 commit 3eede58
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 7 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
echo "VERSION_TAG=v$version" >> "$GITHUB_OUTPUT"
echo "MAJOR_VERSION_TAG=v$(echo $version | cut -d. -f1)" >> "$GITHUB_OUTPUT"
# TODO: remove when wixl is pre-installed on elvia-runner runners
- name: Install dependencies for Windows
if: ${{ matrix.os == 'windows' }}
run: sudo apt-get install -y --no-install-recommends wixl

- name: Package CLI
run: make package-${{ matrix.os }}-${{ matrix.arch }}

Expand Down Expand Up @@ -116,19 +121,19 @@ jobs:
- name: Upload binaries if new version
if: ${{ needs.pre-release.outputs.new-version == 'true' }}
run: |
# Workaround for macOS binaries being named differently from their architecture (darwin)
# Special case for macOS binaries being named differently from their architecture (darwin)
if [[ '${{ matrix.os }}' == 'macos' ]]; then
mv '3lv-darwin-${{ matrix.arch }}.tar.gz' '3lv-macos-${{ matrix.arch }}.tar.gz'
mv '3lv-darwin-${{ matrix.arch }}.tar.gz.md5' '3lv-macos-${{ matrix.arch }}.tar.gz.md5'
fi
# Workaround for Windows being packaged in zip files, not tarballs
# Special case for Windows being packaged as MSI
if [[ '${{ matrix.os }}' != 'windows' ]]; then
gh release upload "$VERSION_TAG" '3lv-${{ matrix.os }}-${{ matrix.arch }}.tar.gz'
gh release upload "$VERSION_TAG" '3lv-${{ matrix.os }}-${{ matrix.arch }}.tar.gz.md5'
else
gh release upload "$VERSION_TAG" '3lv-windows-${{ matrix.arch }}.zip'
gh release upload "$VERSION_TAG" '3lv-windows-${{ matrix.arch }}.zip.md5'
gh release upload "$VERSION_TAG" '3lv-windows-${{ matrix.arch }}.msi'
gh release upload "$VERSION_TAG" '3lv-windows-${{ matrix.arch }}.msi.md5'
fi
env:
GH_TOKEN: ${{ github.token }}
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ package-macos-arm64: package
package-windows-amd64: build-windows-amd64
package-windows-amd64:
mkdir -p ${package_dir}
zip -j ${package_dir}/3lv-windows-amd64.zip LICENSE README.md ${build_dir}/3lv.exe
cd ${package_dir} && md5sum 3lv-windows-amd64.zip > 3lv-windows-amd64.zip.md5
cp LICENSE README.md build/package/3lv.wxs ${build_dir}/3lv.exe ${package_dir}
cd ${package_dir} && wixl -v -o 3lv.msi 3lv.wxs
cd ${package_dir} && md5sum 3lv.msi > 3lv.msi.md5
cd ${package_dir} && rm -f LICENSE README.md 3lv.wxs 3lv.exe

## install: Build and then install the binary to /usr/local/bin. Requires root. Only works on Linux and macOS (tries to guess the OS and architecture).
.PHONY: install
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.17.3
0.18.0-alpha
45 changes: 45 additions & 0 deletions build/package/3lv.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Name='Elvia CLI'
Id='432286C8-BC7F-4919-8432-67107E4E45AA'
UpgradeCode='0CD31A27-AA46-4E75-BDBB-E008F751FC76'
Language='1033'
Codepage='1252'
Version='1.7.3'
Manufacturer='Elvia AS'
>
<Package
Id='*'
Keywords='Installer'
Description="Elvia CLI installer"
Manufacturer='Elvia AS'
InstallerVersion='100'
Languages='1033'
Compressed='yes'
SummaryCodepage='1252'
/>

<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="Elvia CLI Installation [1]" />

<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='Elvia' Name='Elvia'>
<Directory Id='INSTALLDIR' Name='Elvia CLI'>

<Component Id='MainExecutable' Guid='B9716B0E-A39B-4B2E-94CE-250C40018EBB'>
<File Id='3lvEXE' Name='3lv.exe' DiskId='1' Source='3lv.exe' KeyPath='yes'/>
</Component>

</Directory>
</Directory>
</Directory>
</Directory>

<Feature Id='Complete' Level='1'>
<ComponentRef Id='MainExecutable' />
</Feature>

</Product>
</Wix>

0 comments on commit 3eede58

Please sign in to comment.