Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actions: add msi gen pipeline #163

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/actions/msi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: MSI
description: Generate MSI

inputs:
outputs:
runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
toolchain: stable

- name: Cache cargo and target artifacts
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1

# doc: https://volks73.github.io/cargo-wix/cargo_wix
- name: Install cargo-wix
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: install
args: cargo-wix

# doc: https://wixtoolset.org/docs/tools
- name: Install wixtoolset using choco
run: choco install --force -y wixtoolset --version 3.14.0

# workaround to get cargo-wix working
- name: Move bootstrapper.wxs and download vc_redist.x64.exe
run: |
mv wix/bootstrapper.wxs keepme
curl -LO https://aka.ms/vs/17/release/vc_redist.x64.exe
shell: bash

- name: Run cargo-wix
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: wix
args: --nocapture

# candle generates .wixobj files and light creates an installer from it
- name: Run Candle and Light
run: |
mv ../keepme bootstrapper.wxs
candle bootstrapper.wxs -o bootstrapper.wixobj
light bootstrapper.wixobj -ext WixBalExtension.dll -o tidybee-agent.exe
working-directory: wix

- name: Upload artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
path: target\wix\tidybee-agent-0.1.0-x86_64.msi
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@ jobs:

- name: Move binaries
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run:
mv ./target/release/${{ env.BIN_NAME }} ${{ env.ARTIFACT_DIR }}/${{ env.BIN_NAME }}-${{ github.ref_name }}-${{ matrix.target }}/${{ matrix.os }}-${{ env.BIN_NAME }}
run: mv ./target/release/${{ env.BIN_NAME }} ${{ env.ARTIFACT_DIR }}/${{ env.BIN_NAME }}-${{ github.ref_name }}-${{ matrix.target }}/${{ matrix.os }}-${{ env.BIN_NAME }}

- name: Move windows binaries
if: matrix.os == 'windows-latest'
shell: bash
run: |
cp ./target/release/${{ env.BIN_NAME }}.exe ./${{ env.ARTIFACT_DIR }}/${{ env.BIN_NAME }}-${{ github.ref_name }}-${{ matrix.target }}/${{ matrix.os }}-${{ env.BIN_NAME }}.exe

- name: Generate MSI
if: matrix.os == 'windows-latest'
uses: ./.github/actions/msi.yml

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -106,4 +109,4 @@ jobs:
gh release upload ${{ github.ref_name }} \
${{ env.ARTIFACT_DIR }}/x86_64-unknown-linux-gnu-$(echo ${{ github.ref_name }} | sed 's/v//; s/\./-/g')-tidybee-agent \
${{ env.ARTIFACT_DIR }}/x86_64-apple-darwin-$(echo ${{ github.ref_name }} | sed 's/v//; s/\./-/g')-tidybee-agent \
${{ env.ARTIFACT_DIR }}/x86_64-pc-windows-msvc-$(echo ${{ github.ref_name }} | sed 's/v//; s/\./-/g')-tidybee-agent.exe
${{ env.ARTIFACT_DIR }}/x86_64-pc-windows-msvc-$(echo ${{ github.ref_name }} | sed 's/v//; s/\./-/g')-tidybee-agent.exe
Loading