Skip to content

Release Windows

Release Windows #1

on:
release:
types: [published]
workflow_dispatch:
name: Release Windows
jobs:
build:
runs-on: windows-2022
permissions:
contents: write # needed for uploading release artifact
defaults:
run:
shell: msys2 {0}
steps:
- name: Set installer name
id: set_installer_name
shell: bash
run: echo "name=rnote-win-installer-$(echo ${GITHUB_REF_NAME#v})-x86_64" >> $GITHUB_OUTPUT
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
release: false
update: true
install: |
git mingw-w64-x86_64-xz mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-clang mingw-w64-x86_64-toolchain
mingw-w64-x86_64-autotools mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-meson mingw-w64-x86_64-diffutils
mingw-w64-x86_64-desktop-file-utils mingw-w64-x86_64-appstream mingw-w64-x86_64-gtk4 mingw-w64-x86_64-libadwaita
mingw-w64-x86_64-poppler mingw-w64-x86_64-poppler-data mingw-w64-x86_64-angleproject
- name: Remove libpthread.dll.a
run: rm /mingw64/lib/libpthread.dll.a
continue-on-error: true
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable-gnu
- name: Configure PATH
run: echo "export PATH=$PATH:/c/Users/$USER/.cargo/bin:/c/Program\ Files\ \(x86\)/Inno\ Setup\ 6" > ~/.bashrc
- name: Checkout
uses: actions/checkout@v4
- name: Setup
run: meson setup --prefix=C:/msys64/mingw64 -Dwin-installer-name='${{ steps.set_installer_name.outputs.name }}' _mesonbuild
- name: Generate locale files
run: meson compile rnote-gmo -C _mesonbuild
- name: Compile
run: meson compile -v -C _mesonbuild
- name: Build installer
run: meson compile build-installer -C _mesonbuild
- name: Upload installer (Workflow Artifact)
uses: actions/upload-artifact@v3
with:
name: rnote-win-installer-artifact
path: _mesonbuild/${{ steps.set_installer_name.outputs.name }}.exe
if-no-files-found: error
- name: Upload installer (Release Asset)
if: ${{ github.event_name == 'release' }}
shell: powershell
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} _mesonbuild/${{ steps.set_installer_name.outputs.name }}.exe