Windows port 馃帀 馃殌 (#455) #373
This file contains hidden or 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: DEPLOY | |
| on: | |
| push: | |
| branches: [ '**' ] | |
| tags-ignore: [ '**' ] | |
| jobs: | |
| build: | |
| if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+') | |
| strategy: | |
| matrix: | |
| platform: [ "ubuntu-latest", "ubuntu-24.04-arm" ] | |
| # this list should be updated from time to time by consulting these pages: | |
| # https://releases.ubuntu.com/ | |
| # https://wiki.debian.org/DebianReleases#Production_Releases | |
| # https://fedoraproject.org/wiki/Releases | |
| # https://en.wikipedia.org/wiki/OpenSUSE#Version_history | |
| container: [ "ubuntu:22.04", "ubuntu:24.04", "debian:12", "fedora:40", "fedora:41", "opensuse/tumbleweed" ] | |
| runs-on: ${{ matrix.platform }} | |
| container: | |
| image: ${{ matrix.container }} | |
| env: | |
| DIST: ${{ matrix.container }} | |
| DEBIAN_FRONTEND: noninteractive | |
| steps: | |
| - name: install-git | |
| run: | | |
| # Install Git based on distro | |
| if command -v apt-get >/dev/null; then | |
| apt-get update -y | |
| apt-get install -y git | |
| elif command -v dnf >/dev/null; then | |
| dnf install -y git | |
| elif command -v zypper >/dev/null; then | |
| zypper install -y git | |
| elif command -v pacman >/dev/null; then | |
| pacman -Sy git --noconfirm | |
| fi | |
| - name: checkout-source | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: run-builder | |
| shell: bash | |
| run: ./tools/build.sh | |
| - name: Sanitize container name | |
| id: sanitizer | |
| shell: bash | |
| run: | | |
| # Replace colons and slashes with dashes | |
| SANITIZED_CONTAINER=$(echo "${{ matrix.container }}" | sed 's/[:\\/]/-/g') | |
| echo "sanitized_container=$SANITIZED_CONTAINER" >> $GITHUB_OUTPUT | |
| - name: upload-artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pkg-${{ matrix.platform == 'ubuntu-24.04-arm' && 'arm64' || 'x64' }}-${{ steps.sanitizer.outputs.sanitized_container }} | |
| path: artifact | |
| build-windows: | |
| if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+') | |
| runs-on: windows-latest | |
| steps: | |
| - name: checkout-source | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: install-qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '5.15.2' | |
| arch: win64_msvc2019_64 | |
| - name: install-rust-i686-target | |
| run: rustup target add i686-pc-windows-msvc | |
| - name: install-nsis | |
| run: choco install nsis -y | |
| - name: build-and-package | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake .. -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows | |
| cmake --build . --config Release | |
| cpack -G NSIS -C Release | |
| - name: upload-artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pkg-windows-x64 | |
| path: build/OpenBangla-Keyboard-*.exe | |
| build-windows-arm: | |
| if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+') | |
| runs-on: windows-11-arm | |
| steps: | |
| - name: checkout-source | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: setup-msys2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: CLANGARM64 | |
| install: >- | |
| mingw-w64-clang-aarch64-cmake | |
| mingw-w64-clang-aarch64-clang | |
| mingw-w64-clang-aarch64-ninja | |
| mingw-w64-clang-aarch64-qt5-base | |
| mingw-w64-clang-aarch64-qt5-tools | |
| mingw-w64-clang-aarch64-zstd | |
| mingw-w64-clang-aarch64-rust | |
| - name: install-nsis | |
| run: choco install nsis -y | |
| - name: build-and-package | |
| shell: msys2 {0} | |
| run: | | |
| export PATH="/c/Program Files (x86)/NSIS:$PATH" | |
| mkdir build | |
| cd build | |
| cmake .. -G Ninja | |
| cmake --build . | |
| cpack -G NSIS | |
| - name: upload-artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pkg-windows-arm64 | |
| path: build/OpenBangla-Keyboard-*.exe | |
| merge: | |
| needs: [build, build-windows, build-windows-arm] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: merge-artifacts | |
| uses: actions/upload-artifact/merge@v7 | |
| with: | |
| name: packages | |
| pattern: pkg-* | |
| delete-merged: true | |
| release: | |
| if: contains(github.event.head_commit.message, 'deploy+') | |
| needs: merge | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: checkout-source | |
| uses: actions/checkout@v5 | |
| - name: get-version | |
| id: get_version | |
| shell: bash | |
| run: | | |
| RELEASE_VERSION=$(cat version.txt | head -n1) | |
| echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT | |
| - name: download-artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: packages | |
| path: artifacts | |
| - name: create-release | |
| id: create_release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ steps.get_version.outputs.RELEASE_VERSION }} | |
| name: ${{ steps.get_version.outputs.RELEASE_VERSION }} | |
| artifacts: "artifacts/*" | |
| allowUpdates: true | |
| draft: true | |
| body: | | |
| []() | |
| ### Changes in this release: | |
| - ... |