Skip to content

Commit

Permalink
Client Installers (#163)
Browse files Browse the repository at this point in the history
* try restructure ci


Update app.yml
Update app.yml
try fix ci script


try install qt on ci


try install qt on ci


merge conflict resolution for `feature/deps`


try installing karchive


try installing karchive


try installing karchive


add zlib... and sudo...


try fix windows + cmake client


chmod for install script

try fix windows...


try fix all...


try cpack with qtifw


try fix qtifw


try fix qtifw


fdfd

* try fix pre-cpack steps

* split into unix and windows

* try fix

* enable cache with versioning

* try fix

* Update deploy-client.yml

* try fix

* try fix

* try fix cpack

* caching

* try fix

* try fix

* add appimage

* try fix windows + artifacts

* try fix

* try fix unix

* try fix

* try with full 3rdparty libs

* try fix ecm

* try fix ecm

* try kde craft

* try kde craft

* try kde craft

* try kde craft

* try kde craft

* try kde craft

* try kde craft

* try kde craft

* try kde craft

* try kde craft with icons

* try kde craft linux icons

* try kde craft without linux icon

* try fix: enable cache + try icons

* set new cache

* try fix desktop

* try icons

* try new cache

* try fix icons

* try fix linuxdeploy

* try fix desktop

* improvements

* try fix cache

* try release + try fix windows icon

* try fix release

* rename files for releases

* fix renaming releases

* end of installer saga

* [ci] remove docker check
  • Loading branch information
waleko authored May 29, 2022
1 parent 4cc970d commit 1eba9b9
Show file tree
Hide file tree
Showing 19 changed files with 444 additions and 202 deletions.
62 changes: 62 additions & 0 deletions .craft.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[General]
Command = craft
Branch = master
ShallowClone = True

# Variables defined here override the default value
# The variable names are casesensitive
[Variables]
#Values need to be overwritten to create a chache
UseCache = True
CreateCache = True

[GeneralSettings]
Version/ConfigVersion = 6

Packager/Destination=${Variables:WORKSPACE}/binaries
Paths/Python = C:/Python36
Paths/Python27 = C:/Python27
Paths/DownloadDir = ${Variables:Root}/downloads
ShortPath/Enabled = False
Compile/BuildType = Release
ContinuousIntegration/Enabled = True
Packager/PackageDebugSymbols = False

Packager/CacheDir = ${Variables:WORKSPACE}/cache
Packager/UseCache = ${Variables:UseCache}
Packager/CreateCache = ${Variables:CreateCache}

[windows-msvc2019_64-cl]
General/ABI = windows-msvc2019_64-cl

[windows-msvc2019_64-cl-debug]
General/ABI = windows-msvc2019_64-cl
Compile/BuildType = Debug

[windows-msvc2019_32-cl]
General/ABI = windows-msvc2019_32-cl

[macos-64-clang]
General/ABI = macos-64-clang
# Packager/PackageType = MacPkgPackager

[macos-64-clang-debug]
General/ABI = macos-64-clang
Compile/BuildType = Debug

[linux-64-gcc]
General/ABI = linux-64-gcc

[linux-64-gcc-BlueprintSettings]
libs/dbus.ignored = False
libs/qt5/qtbase.withDBus = True
dev-utils/7zip.useCentosBasedBuild=True

[linux-64-gcc-debug]
General/ABI = linux-64-gcc
Compile/BuildType = Debug

[linux-64-gcc-debug-BlueprintSettings]
libs/dbus.ignored = False
libs/qt5/qtbase.withDBus = True
dev-utils/7zip.useCentosBasedBuild=True
3 changes: 3 additions & 0 deletions .craft.shelf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[General]
version = 2
blueprintrepositories = https://github.com/cavoke-project/craft-blueprints-cavoke.git|master|;https://invent.kde.org/packaging/craft-blueprints-kde.git|master|
13 changes: 13 additions & 0 deletions .github/scripts/.craft.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if ($IsWindows) {
$python = (Get-Command py).Source
} else {
$python = (Get-Command python3).Source
}
$command = @("${env:HOME}/craft/CraftMaster/CraftMaster/CraftMaster.py",
"--config", "${env:GITHUB_WORKSPACE}/.craft.ini",
"--target", "${env:CRAFT_TARGET}",
"--variables", "WORKSPACE=${env:HOME}/craft") + $args

Write-Host "Exec: ${python} ${command}"

& $python @command
191 changes: 9 additions & 182 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
@@ -1,186 +1,13 @@
name: app
name: Cavoke
on:
push
jobs:
clang-format:
name: ClangFormat 12
runs-on: ubuntu-latest
container: ghcr.io/cavoke-project/cavoke-ci:codeql
timeout-minutes: 1
steps:
- uses: actions/checkout@v2
# do not check submodules
- run: clang-format-12 --version
- run: chmod +x .github/scripts/diff-clangformat-12.sh && find . \( -iname '*.cpp' -or -iname '*.c' -or -iname '*.h' \) -and -not -path './server/models/*' | xargs -n1 .github/scripts/diff-clangformat-12.sh
cppcheck:
name: Cppcheck
runs-on: ubuntu-latest
container: ghcr.io/cavoke-project/cavoke-ci:codeql
timeout-minutes: 1
steps:
- uses: actions/checkout@v2
# do not check submodules
- run: cppcheck --version
- run: cppcheck --language=c++ -DSOME_DEFINE_TO_FIX_CONFIG --enable=all --suppress=*:doctest.h --suppress=unusedFunction --error-exitcode=1 --inline-suppr $(find . -iname '*.cpp' -and -not -path './server/models/*')
client-notests-qt5-suse:
runs-on: ubuntu-latest
container: ghcr.io/cavoke-project/cavoke-ci:client-qt5-suse
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cmake
run: mkdir build && cd build && cmake .. -DBUILD_ALL=OFF -DBUILD_CLIENT=ON -DQT_MAJOR_VERSION=5
- name: Make
run: cd build && make cavoke_client
client-notests-qt6-suse:
runs-on: ubuntu-latest
container: ghcr.io/cavoke-project/cavoke-ci:client-qt6-suse
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cmake
run: mkdir build && cd build && cmake .. -DBUILD_ALL=OFF -DBUILD_CLIENT=ON -DQT_MAJOR_VERSION=6 # QT_MAJOR_VERSION=6 by default, so not necessary
- name: Make
run: cd build && make cavoke_client
server-compiles-with-submodules:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install -y openssl libssl-dev libjsoncpp-dev uuid-dev zlib1g-dev libc-ares-dev postgresql-server-dev-all libboost-all-dev
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cmake
run: mkdir build && cd build && cmake .. -DBUILD_ALL=OFF -DBUILD_SERVER=ON
- name: Make
run: cd build && make cavoke_server
server-healthcheck:
runs-on: ubuntu-latest
container: ghcr.io/cavoke-project/cavoke-ci:server
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: cavoke
POSTGRES_PASSWORD: postgres_password
POSTGRES_PORT: 5432
POSTGRES_USER: postgres_user
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install PostgreSQL client
run: |
apt-get update
apt-get install --yes postgresql-client
- name: Populate the database
run: psql -h postgres -d cavoke -U postgres_user -f server/db/schema.sql
env:
PGPASSWORD: postgres_password
- name: Cmake
run: mkdir build && cd build && cmake .. -DBUILD_ALL=OFF -DBUILD_SERVER=ON -DUSE_EXTERNAL_DROGON=ON -DUSE_EXTERNAL_NLOHMANN=ON -DUSE_EXTERNAL_JWT=ON
- name: Make
run: cd build && make cavoke_server
- name: Healthcheck
run: chmod +x .github/scripts/server-test-health.py && .github/scripts/server-test-health.py ./build/server/cavoke_server -c .github/files/ci_server_config.json
server-tests:
runs-on: ubuntu-latest
container: ghcr.io/cavoke-project/cavoke-ci:server
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cmake
run: mkdir build && cd build && cmake .. -DBUILD_ALL=OFF -DBUILD_SERVER=ON -DUSE_EXTERNAL_DROGON=ON -DUSE_EXTERNAL_NLOHMANN=ON -DUSE_EXTERNAL_JWT=ON
- name: Make
run: cd build && make cavoke_server_test
- name: Run Tests
run: ./build/server/test/cavoke_server_test
games-notests:
runs-on: ubuntu-latest
container: ghcr.io/cavoke-project/cavoke-ci:server
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cmake
run: mkdir build && cd build && cmake .. -DBUILD_ALL=OFF -DBUILD_GAMES=ON -DUSE_EXTERNAL_DROGON=ON -DUSE_EXTERNAL_NLOHMANN=ON -DUSE_EXTERNAL_JWT=ON
- name: Make
run: cd build && make all
server-docker-compose-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Start up the server with Docker Compose
run: docker-compose up -d
- name: Healthcheck
run: test $(curl -s localhost:8080/health) = "OK"
- name: Check that some games are available
run: curl -s localhost:8080/games/list | jq -e 'length >= 1'
server-publish-image-develop:
runs-on: ubuntu-latest
tests:
uses: ./.github/workflows/tests.yml
bundle-client:
needs: [tests]
uses: ./.github/workflows/bundle-client-craft.yml
deploy-server-develop:
if: github.ref == 'refs/heads/develop'
# environment: develop
needs:
- server-healthcheck
- server-docker-compose-check
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
file: server.Dockerfile
push: true
tags: ghcr.io/cavoke-project/cavoke-server:latest # TODO: different tag for different branches
server-deploy-cloud-run-develop:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
environment:
name: develop
url: https://develop.api.cavoke.wlko.me
concurrency: develop
needs:
- server-publish-image-develop
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ env.PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: 'Deploy to Cloud Run'
run: |
gcloud components install beta && \
gcloud beta run deploy cavoke-server-develop \
--execution-environment gen2 \
--source server/.gcp \
--allow-unauthenticated \
--service-account ${{ env.SERVICE_ACCOUNT }} \
--region=${{ env.REGION }} \
--update-env-vars BUCKET=${{ env.BUCKET_NAME }}
env:
PROJECT_ID: waleko-personal
SERVICE_ACCOUNT: fs-identity
BUCKET_NAME: cavoke-test-1
REGION: europe-north1
needs: [tests]
uses: ./.github/workflows/deploy-server-develop.yml
113 changes: 113 additions & 0 deletions .github/workflows/bundle-client-craft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Originally from: https://raw.githubusercontent.com/owncloud/client/9ef42e4faa56367d99e31b5cc3e5f91da9b865f7/.github/workflows/main.yml

name: Bundle Client
on: workflow_call

defaults:
run:
shell: pwsh

jobs:
build:
strategy:
matrix:
include:
- name: Windows 64-bit cl
target: windows-msvc2019_64-cl
os: windows-latest
fetch-depth: 0
container:
- name: macOS 64-bit clang
target: macos-64-clang
os: macos-latest
fetch-depth: 1
container:
- name: CentOS 7 64-bit gcc
target: linux-64-gcc
os: ubuntu-latest
container: kdeorg/centos7-craft
fetch-depth: 1
fail-fast: false

name: ${{ matrix.name }}

runs-on: ${{ matrix.os }}

env:
CRAFT_TARGET: ${{ matrix.target }}

container: ${{ matrix.container }}

steps:
- name: Check out source code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Restore cache
uses: actions/cache@v2
with:
path: ~/craft/cache
key: ${{ runner.os }}-${{ matrix.target }}-v3

- name: Clone CraftMaster
run: git clone --depth=1 https://invent.kde.org/kde/craftmaster.git "$env:HOME/craft/CraftMaster/CraftMaster"

- name: Craft setup
run: |
New-Item -Path ~/cache -ItemType Directory -ErrorAction SilentlyContinue
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" --setup
- name: Craft unshelve
run: |
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c --unshelve "${env:GITHUB_WORKSPACE}/.craft.shelf"
- name: Prepare
run: |
if ($IsWindows) {
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c dev-utils/nsis
} elseif($IsLinux) {
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c dev-utils/linuxdeploy
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c --set enableLibcloudproviders=true cavoke
}
- name: Install dependencies
run: |
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c --install-deps cavoke
- name: Build
run: |
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c --no-cache --src-dir "${env:GITHUB_WORKSPACE}" cavoke
- name: Package
run: |
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c --no-cache --src-dir "${env:GITHUB_WORKSPACE}" --package cavoke
- name: Prepare artifacts
run: |
New-Item -ItemType Directory "${env:GITHUB_WORKSPACE}/binaries/" -ErrorAction SilentlyContinue
Copy-Item "$env:HOME/craft/binaries/*" "${env:GITHUB_WORKSPACE}/binaries/"
& "${env:GITHUB_WORKSPACE}/.github/scripts/.craft.ps1" -c --shelve "${env:GITHUB_WORKSPACE}/.craft.shelf"
Copy-Item "${env:GITHUB_WORKSPACE}/.craft.shelf" "${env:GITHUB_WORKSPACE}/binaries/"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}
path: ${{ github.workspace }}/binaries/*
create-release:
name: Create Release
needs: [ build ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Rename files
run: |
find -name '*.exe' -exec mv '{}' './cavoke-${{ github.ref_name }}-windows.exe' ';'
find -name '*.dmg' -exec mv '{}' './cavoke-${{ github.ref_name }}-macos.dmg' ';'
find -name '*.AppImage' -exec mv '{}' './cavoke-${{ github.ref_name }}-linux.AppImage' ';'
- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
draft: true
files: |
cavoke-*-windows.exe
cavoke-*-macos.dmg
cavoke-*-linux.AppImage
fail_on_unmatched_files: true
Loading

0 comments on commit 1eba9b9

Please sign in to comment.