Files
deskflow/.github/workflows/ci.yml
Nick Bolton 7103bbed6d Re-implement CI auto version increment for packaging (#7354)
* Only install Python deps with deps script

* Remove hard-coded Qt version in CI

* Add example .env

* Improve comments in .env file

* Simplify config reader and Choco CI config

* Actually return the config value

* Move deps before Qt version env call

* Remove `self.`

* Move venv ensure to main

* Fixed arg

* Move config import to function

* Move ensure_module to function

* Simplify over-complicated `Version.cmake`

* Move code to `github` module

* Use `symless/next-version-action`

* Make CMake version file even simpler

* Set version from tag

* Create release when master or release branch

* Don't run CI on master push, only release

* Fixed bac macro

* Use new version values

* Handle empty version env var

* Also strip version file value

* Remove quotes

* Add @master to action

* Read version from file

* Simplify version file read

* Fixed typo in env var

* Remove unused var

* Delete legacy build number action

* Fixed env var

* Version file read shouldn't be needed

* Remove weird and unnecessary include path

* Update ChangeLog

* Remove unused config value

* Better name for changelog check

* Delete broken Flatpak CI

* Run stale issue cron at midnight

* Update ChangeLog

* Add version input for manual run

* Print next version

* Fetch all tags

* Use more idiomatic approach

* Set to pre-release when master

* Remove unnecessary `commitish`

* Fixed wrong ID

* More specific IDs

* Reduce config needed for upload

* Only /release can be non-pre-release

* More discreet package path for gdrive

* Try without setting path

* Remove seemly unused step

* Better name for Qt version step

* Fixed bad var ref

* Better name for package dir

* Fixed bad input name

* Add missing shell

* Workflow to test upload action

* Remove fetch tags

* Use bash to cut version

* Remove name and make conditional

* Replace deprecated set-output

* Fixed env var name

* Missing dir sep char

* Add comment to test workflow

* Improve input descriptions

* Replace deprecated set-output
2024-06-26 15:46:42 +00:00

214 lines
5.9 KiB
YAML

name: CI
on:
workflow_dispatch:
inputs:
version:
description: Synergy version number
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
release:
types: [published]
env:
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
UPLOAD_TO_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
UPLOAD_TO_GDRIVE: ${{ github.event_name != 'pull_request' }}
jobs:
windows:
name: windows-2022
runs-on: windows-2022
timeout-minutes: 20
env:
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install dependencies
run: python ./scripts/install_deps.py
- name: Set QT_VERSION env var
run: python ./scripts/github_env.py --set-qt-version
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ${{ env.QT_BASE_DIR }}
key: ${{ runner.os }}-Qt_${{ env.QT_VERSION }}
- name: Install Qt
if: steps.cache-qt.outputs.cache-hit != 'true'
run: python ./scripts/install_deps.py --only qt
- name: Setup VC++ environment
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
env:
CMAKE_PREFIX_PATH: "${{ env.QT_BASE_DIR }}\\${{ env.QT_VERSION }}\\msvc2019_64\\"
run: cmake -B build --preset=windows-release
- name: Build
run: cmake --build build
- name: Test
run: ./build/bin/unittests
- name: Package
if: ${{ !github.event.pull_request.draft }}
run: python ./scripts/package.py
macos:
runs-on: ${{ matrix.runtime.os }}
timeout-minutes: ${{ matrix.runtime.timeout }}
name: ${{ matrix.runtime.name }}
defaults:
run:
shell: ${{ matrix.runtime.shell }}
strategy:
matrix:
runtime:
- name: "macos-10-intel"
timeout: 20
os: "macos-14-large"
arch: x64
target: "10.14"
shell: "bash"
- name: "macos-11-m1"
timeout: 10
os: "macos-14"
arch: arm64
target: "11"
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install dependencies
run: ./scripts/install_deps.py
- name: Configure
env:
CMAKE_OSX_DEPLOYMENT_TARGET: ${{ matrix.runtime.target }}
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
- name: Build
run: cmake --build build
- name: Test
run: ./build/bin/unittests
- name: Package
if: ${{ !github.event.pull_request.draft }}
run: ./scripts/package.py
env:
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
APPLE_P12_CERTIFICATE: ${{ secrets.APPLE_P12_CERTIFICATE }}
APPLE_P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }}
APPLE_NOTARY_USER: ${{ secrets.APPLE_NOTARY_USER }}
APPLE_NOTARY_PASSWORD: ${{ secrets.APPLE_NOTARY_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Upload
if:
uses: ./.github/actions/dist-upload
with:
use_github: ${{ env.UPLOAD_TO_GITHUB }}
use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
github-target-filename: "synergy-macos-${{ matrix.runtime.target }}"
gdrive-target-base-dir: "synergy1/personal"
gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
package-version: ${{ env.SYNERGY_VERSION }}
linux:
runs-on: ${{ matrix.distro.runs-on }}
timeout-minutes: 10
name: linux-${{ matrix.distro.name }}
container: ${{ matrix.distro.container }}
strategy:
matrix:
distro:
- name: centos-8
container: symless/synergy-core:centos8
runs-on: ubuntu-latest
legacy-cmake: true
- name: debian-11
container: symless/synergy-core:debian11
runs-on: ubuntu-latest
legacy-cmake: true
- name: debian-12
container: symless/synergy-core:debiansid
runs-on: ubuntu-latest
- name: fedora-37
container: symless/synergy-core:fedora37
runs-on: ubuntu-latest
legacy-cmake: true
- name: fedora-38
container: symless/synergy-core:fedora38
runs-on: ubuntu-latest
legacy-cmake: true
- name: ubuntu-20.04
container: symless/synergy-core:ubuntu20.04
runs-on: ubuntu-latest
legacy-cmake: true
- name: ubuntu-22.04
container: symless/synergy-core:ubuntu22.04
runs-on: ubuntu-latest
- name: ubuntu-24.04
runs-on: ubuntu-24.04
steps:
# Use @v3 since some older Linux distro versions don't support @v4
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Install dependencies
run: ./scripts/install_deps.py
- name: Configure (modern)
if: ${{ !matrix.distro.legacy-cmake }}
run: cmake -B build --preset=linux-release
# Some older Linux distro versions don't support modern CMake presets.
- name: Configure (legacy)
if: ${{ matrix.distro.legacy-cmake }}
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build
- name: Test
run: ./build/bin/unittests
- name: Package
if: ${{ !github.event.pull_request.draft }}
run: ./scripts/package.py