mirror-chatterino2/.github/workflows/create-installer.yml
nerix accf91a48f
Build Windows Installer in CI (#4408)
* feat: build installer in CI

Co-authored-by: 8thony <114905842+8thony@users.noreply.github.com>

* fix: use inno-setup from PATH

* fix: only match `v*` tags

* fix: don't add to release

* fix: only run on master

---------

Co-authored-by: 8thony <114905842+8thony@users.noreply.github.com>
2023-08-05 12:27:09 +00:00

56 lines
1.8 KiB
YAML

name: Create installer
on:
workflow_run:
workflows: ["Build"]
types: [completed]
# make sure this only runs on the default branch
branches: [master]
workflow_dispatch:
jobs:
create-installer:
runs-on: windows-latest
# Only run manually or when a build succeeds
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
qt-version: [5.15.2, 6.5.0]
env:
VARIANT_SUFFIX: ${{ startsWith(matrix.qt-version, '6.') && '.EXPERIMENTAL-Qt6' || '' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # allows for tags access
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
name: chatterino-windows-x86-64-Qt-${{ matrix.qt-version }}.zip
path: build/
- name: Unzip
run: 7z e -spf chatterino-windows-x86-64-Qt-${{ matrix.qt-version }}.zip
working-directory: build
- name: Install InnoSetup
run: choco install innosetup
- name: Add InnoSetup to path
run: echo "C:\Program Files (x86)\Inno Setup 6\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.12.1
- name: Build installer
id: build-installer
working-directory: build
run: ..\.CI\build-installer.ps1
shell: powershell
- name: Upload installer
uses: actions/upload-artifact@v3
with:
path: build/${{ steps.build-installer.outputs.C2_INSTALLER_BASE_NAME }}${{ env.VARIANT_SUFFIX }}.exe
name: ${{ steps.build-installer.outputs.C2_INSTALLER_BASE_NAME }}${{ env.VARIANT_SUFFIX }}.exe