qsv Windows Installer #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 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 }} | |