aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml83
-rw-r--r--.github/workflows/codeql.yml35
-rw-r--r--.github/workflows/trigger_builds.yml4
-rw-r--r--.github/workflows/trigger_release.yml1
4 files changed, 100 insertions, 23 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3225cf1e..79221531 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,10 +7,17 @@ on:
description: Type of build (Debug, Release, RelWithDebInfo, MinSizeRel)
type: string
default: Debug
+ is_qt_cached:
+ description: Enable Qt caching or not
+ type: string
+ default: true
secrets:
SPARKLE_ED25519_KEY:
description: Private key for signing Sparkle updates
required: false
+ CACHIX_AUTH_TOKEN:
+ description: Private token for authenticating against Cachix cache
+ required: false
jobs:
build:
@@ -102,14 +109,6 @@ jobs:
with:
submodules: 'true'
- - name: Initialize CodeQL
- if: runner.os == 'Linux' && matrix.qt_ver == 6
- uses: github/codeql-action/init@v2
- with:
- config-file: ./.github/codeql/codeql-config.yml
- queries: security-and-quality
- languages: cpp, java
-
- name: 'Setup MSYS2'
if: runner.os == 'Windows' && matrix.msystem != ''
uses: msys2/setup-msys2@v2
@@ -200,8 +199,7 @@ jobs:
arch: ${{ matrix.qt_arch }}
modules: ${{ matrix.qt_modules }}
tools: ${{ matrix.qt_tools }}
- cache: true
- cache-key-prefix: ${{ matrix.qt_host }}-${{ matrix.qt_version }}-"${{ matrix.qt_modules }}"-qt_cache
+ cache: ${{ inputs.is_qt_cached }}
- name: Prepare AppImage (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 5
@@ -235,7 +233,7 @@ jobs:
- name: Configure CMake (Windows MSVC)
if: runner.os == 'Windows' && matrix.msystem == ''
run: |
- cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" -A${{ matrix.architecture}}
+ cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" -A${{ matrix.architecture}} -DLauncher_FORCE_BUNDLED_LIBS=ON
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio (I coudn't figure out the compiler prefix)
if ("${{ env.CCACHE_VAR }}")
{
@@ -293,14 +291,6 @@ jobs:
ctest -E "^example64|example$" --test-dir build --output-on-failure -C ${{ inputs.build_type }}
##
- # CODE SCAN
- ##
-
- - name: Perform CodeQL Analysis
- if: runner.os == 'Linux' && matrix.qt_ver == 6
- uses: github/codeql-action/analyze@v2
-
- ##
# PACKAGE BUILDS
##
@@ -500,21 +490,72 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
+ if: inputs.build_type == 'Debug'
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set short version
shell: bash
+ if: inputs.build_type == 'Debug'
run: |
ver_short=`git rev-parse --short HEAD`
echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: Package Snap (Linux)
id: snapcraft
- if: runner.os == 'Linux' && matrix.qt_ver != 5
+ if: inputs.build_type == 'Debug'
uses: snapcore/action-build@v1
- name: Upload Snap (Linux)
- if: runner.os == 'Linux' && matrix.qt_ver != 5
+ if: inputs.build_type == 'Debug'
uses: actions/upload-artifact@v3
with:
name: prismlauncher_${{ env.VERSION }}_amd64.snap
path: ${{ steps.snapcraft.outputs.snap }}
+
+ flatpak:
+ runs-on: ubuntu-latest
+ container:
+ image: bilelmoussaoui/flatpak-github-actions:kde-5.15-22.08
+ options: --privileged
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ if: inputs.build_type == 'Debug'
+ with:
+ submodules: 'true'
+ - name: Build Flatpak (Linux)
+ if: inputs.build_type == 'Debug'
+ uses: flatpak/flatpak-github-actions/flatpak-builder@v4
+ with:
+ bundle: "Prism Launcher.flatpak"
+ manifest-path: flatpak/org.prismlauncher.PrismLauncher.yml
+ cache-key: flatpak-${{ github.sha }}-x86_64
+
+ nix:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ package:
+ - prismlauncher
+ - prismlauncher-qt5
+ steps:
+ - name: Clone repository
+ if: inputs.build_type == 'Debug'
+ uses: actions/checkout@v3
+ with:
+ submodules: 'true'
+ - name: Install nix
+ if: inputs.build_type == 'Debug'
+ uses: cachix/install-nix-action@v18
+ with:
+ install_url: https://nixos.org/nix/install
+ extra_nix_config: |
+ auto-optimise-store = true
+ experimental-features = nix-command flakes
+ - uses: cachix/cachix-action@v12
+ if: inputs.build_type == 'Debug'
+ with:
+ name: prismlauncher
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+ - name: Build
+ if: inputs.build_type == 'Debug'
+ run: nix build .#${{ matrix.package }} --print-build-logs
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 00000000..0cd1f6e4
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,35 @@
+name: "CodeQL Code Scanning"
+
+on: [ push, pull_request, workflow_dispatch ]
+
+jobs:
+ CodeQL:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ with:
+ submodules: 'true'
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ config-file: ./.github/codeql/codeql-config.yml
+ queries: security-and-quality
+ languages: cpp, java
+
+ - name: Install Dependencies
+ run:
+ sudo apt-get -y update
+
+ sudo apt-get -y install ninja-build extra-cmake-modules scdoc qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5
+
+ - name: Configure and Build
+ run: |
+ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr -DLauncher_QT_VERSION_MAJOR=5 -G Ninja
+
+ cmake --build build
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/trigger_builds.yml b/.github/workflows/trigger_builds.yml
index 8adaa5e5..a08193a0 100644
--- a/.github/workflows/trigger_builds.yml
+++ b/.github/workflows/trigger_builds.yml
@@ -8,7 +8,6 @@ on:
- '**.md'
- '**/LICENSE'
- 'flake.lock'
- - '**.nix'
- 'packages/**'
- '.github/ISSUE_TEMPLATE/**'
- '.markdownlint**'
@@ -17,7 +16,6 @@ on:
- '**.md'
- '**/LICENSE'
- 'flake.lock'
- - '**.nix'
- 'packages/**'
- '.github/ISSUE_TEMPLATE/**'
- '.markdownlint**'
@@ -30,5 +28,7 @@ jobs:
uses: ./.github/workflows/build.yml
with:
build_type: Debug
+ is_qt_cached: true
secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}
+ CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml
index d415b2b1..8baa9693 100644
--- a/.github/workflows/trigger_release.yml
+++ b/.github/workflows/trigger_release.yml
@@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/build.yml
with:
build_type: Release
+ is_qt_cached: false
secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}