Skip to content

qsv Windows Installer #62

qsv Windows Installer

qsv Windows Installer #62

name: qsv Windows Installer
on:
workflow_dispatch:
jobs:
analyze-tags:
runs-on: ubuntu-20.04
outputs:
previous-tag: ${{ steps.previoustag.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
build:
needs: analyze-tags
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Wix Toolset
run: |
# Download the latest stable release of Wix Toolset
$url = 'https://github.com/wixtoolset/wix3/releases/latest/download/wix314-binaries.zip'
Invoke-WebRequest -Uri $url -OutFile 'wix.zip'
# Extract the downloaded zip file
Expand-Archive -Path 'wix.zip' -DestinationPath 'wix'
- name: Build Wix Installer
run: |
# Set the path to the Wix Toolset bin folder
$env:PATH += ';$(Agent.WorkFolder)\wix\bin'
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install cargo-wix
run: cargo install cargo-wix
- name: Init cargo-wix
run: cargo wix init
- name: Download Release Asset
id: download
run: |
$LATEST_TAG=$(git describe --tags --abbrev=0)
Write-Output "Latest tag: $LATEST_TAG"
$url="https://github.com/jqnatividad/qsv/releases/latest/download/qsv-${LATEST_TAG}-x86_64-pc-windows-msvc.zip"
Write-Output "URL: $url"
Invoke-WebRequest -Uri $url -OutFile 'release.zip'
- name: Extract and Copy
run: |
mkdir extracted_files
unzip -q release.zip -d extracted_files
cp extracted_files/qsv.exe contrib/wix
- name: Build Wix Installer
run: |
rm wix/main.wxs
cargo wix -I contrib/wix/app.wxs --nocapture
cp target\wix\*.msi qsv-${{ needs.analyze-tags.outputs.previous-tag }}.msi
- name: Sign qsv MSI installer file with Azure Trusted Signing
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: ${{ secrets.AZURE_ENDPOINT }}
trusted-signing-account-name: ${{ secrets.AZURE_TRUSTED_SIGNING_NAME }}
certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }}
files: qsv-${{ needs.analyze-tags.outputs.previous-tag }}.msi
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Upload zipped binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: qsv-${{ needs.analyze-tags.outputs.previous-tag }}.msi
asset_name: qsv-${{ needs.analyze-tags.outputs.previous-tag }}.msi
overwrite: true
tag: ${{ needs.analyze-tags.outputs.previous-tag }}