Skip to content

Commit

Permalink
feat: windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
pxseu committed Aug 3, 2022
1 parent d537071 commit 0577f5f
Show file tree
Hide file tree
Showing 13 changed files with 955 additions and 51 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/release.yml
Expand Up @@ -99,21 +99,20 @@ jobs:
profile: minimal
override: true

- name: Install Wix [Windows]
if: matrix.os == 'windows-latest'
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-wix

- name: Build release binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target ${{ matrix.target }}
use-cross: ${{ matrix.os == 'ubuntu-latest' }}

- name: Prepare binaries [Windows]
if: matrix.os == 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
strip hop.exe
7z a ../../../hop-${{ matrix.platform }}.zip hop.exe
cd -
- name: Prepare binaries [*nix]
if: matrix.os != 'windows-latest'
run: |
Expand All @@ -122,12 +121,34 @@ jobs:
tar czvf ../../../hop-${{ matrix.platform }}.tar.gz hop
cd -
- name: Upload artifacts
- name: Prepare binaries [Windows]
if: matrix.os == 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
strip hop.exe
7z a ../../../hop-${{ matrix.platform }}.zip hop.exe
cd -
- name: Build installer [Windows]
if: matrix.os == 'windows-latest'
uses: actions-rs/cargo@v1
with:
command: wix
args: -I .\build\windows\main.wxs -v --no-build --nocapture --target ${{ matrix.target }} --output target/wix/hop-${{ matrix.platform }}.msi

- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: hop-${{ matrix.platform }}.${{ matrix.os == 'windows-latest' && 'zip' || 'tar.gz' }}
path: hop-${{ matrix.platform }}.${{ matrix.os == 'windows-latest' && 'zip' || 'tar.gz' }}

- name: Upload installer [Windows]
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: hop-${{ matrix.platform }}.msi
path: target/wix/hop-${{ matrix.platform }}.msi

publish-release:
name: Publish Release
needs: ["draft-release", "build-release"]
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,4 @@
{
"rust-analyzer.checkOnSave.command": "clippy",
"editor.defaultFormatter": "rust-lang.rust-analyzer",
}

0 comments on commit 0577f5f

Please sign in to comment.