aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-07-10 19:38:30 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-07-10 19:38:30 +0200
commitb3b76d5d56f9b6849464a6df2031058c98359fbc (patch)
tree211464fb189ef1202093f206d93f3b9f139fd284 /.github
parent3bc02b9662b84c2ab86b5de1b08b4537177fde90 (diff)
parentcd948dceaed4625e7a876f680d3dc028e6cfe6de (diff)
downloadPrismLauncher-b3b76d5d56f9b6849464a6df2031058c98359fbc.tar.gz
PrismLauncher-b3b76d5d56f9b6849464a6df2031058c98359fbc.tar.bz2
PrismLauncher-b3b76d5d56f9b6849464a6df2031058c98359fbc.zip
Merge branch 'develop' into feature/sparkle-mac
# Conflicts: # .github/workflows/build.yml
Diffstat (limited to '.github')
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.yml2
-rw-r--r--.github/dco.yml2
-rw-r--r--.github/workflows/backport.yml19
-rw-r--r--.github/workflows/build.yml104
-rw-r--r--.github/workflows/pr-comment.yml61
-rw-r--r--.github/workflows/trigger_release.yml11
-rw-r--r--.github/workflows/winget.yml14
7 files changed, 110 insertions, 103 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index b387f46a..bac73932 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -27,7 +27,7 @@ body:
attributes:
label: Version of PolyMC
description: The version of PolyMC used in the bug report.
- placeholder: PolyMC 1.2.2
+ placeholder: PolyMC 1.3.2
validations:
required: true
- type: textarea
diff --git a/.github/dco.yml b/.github/dco.yml
new file mode 100644
index 00000000..7993b95c
--- /dev/null
+++ b/.github/dco.yml
@@ -0,0 +1,2 @@
+allowRemediationCommits:
+ individual: true
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
deleted file mode 100644
index fa287a2c..00000000
--- a/.github/workflows/backport.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Backport PR to stable
-on:
- pull_request:
- branches: [ develop ]
- types: [ closed ]
-jobs:
- release_pull_request:
- if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backport')
- runs-on: ubuntu-latest
- steps:
- - name: checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: Backport PR by cherry-pick-ing
- uses: Nathanmalnoury/gh-backport-action@master
- with:
- pr_branch: 'stable'
- github_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index abab0ed0..fbbc1417 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -20,20 +20,31 @@ jobs:
include:
- os: ubuntu-20.04
+ qt_ver: 5
- os: ubuntu-20.04
appimage: true
+ qt_ver: 6
+ qt_host: linux
+ qt_version: '6.3.1'
+ qt_modules: 'qt5compat qtimageformats'
- os: windows-2022
- name: "Windows-i686"
+ name: "Windows-Legacy"
msystem: mingw32
+ qt_ver: 5
- os: windows-2022
- name: "Windows-x86_64"
- msystem: mingw64
+ name: "Windows"
+ msystem: mingw32
+ qt_ver: 6
- - os: macos-11
- macosx_deployment_target: 10.13
+ - os: macos-12
+ macosx_deployment_target: 10.14
+ qt_ver: 6
+ qt_host: mac
+ qt_version: '6.3.1'
+ qt_modules: 'qt5compat qtimageformats'
runs-on: ${{ matrix.os }}
@@ -43,6 +54,7 @@ jobs:
INSTALL_PORTABLE_DIR: "install-portable"
INSTALL_APPIMAGE_DIR: "install-appdir"
BUILD_DIR: "build"
+ CCACHE_VAR: ""
steps:
##
@@ -64,9 +76,15 @@ jobs:
pacboy: >-
toolchain:p
cmake:p
+ extra-cmake-modules:p
ninja:p
- qt5:p
+ qt${{ matrix.qt_ver }}-base:p
+ qt${{ matrix.qt_ver }}-svg:p
+ qt${{ matrix.qt_ver }}-imageformats:p
+ quazip-qt${{ matrix.qt_ver }}:p
ccache:p
+ nsis:p
+ ${{ matrix.qt_ver == 6 && 'qt6-5compat:p' || '' }}
- name: Setup ccache
if: runner.os != 'Windows' && inputs.build_type == 'Debug'
@@ -84,6 +102,12 @@ jobs:
ccache -p # Show config
ccache -z # Zero stats
+ - name: Use ccache on Debug builds only
+ if: inputs.build_type == 'Debug'
+ shell: bash
+ run: |
+ echo "CCACHE_VAR=ccache" >> $GITHUB_ENV
+
- name: Retrieve ccache cache (Windows)
if: runner.os == 'Windows' && inputs.build_type == 'Debug'
uses: actions/cache@v3.0.2
@@ -99,22 +123,32 @@ jobs:
ver_short=`git rev-parse --short HEAD`
echo "VERSION=$ver_short" >> $GITHUB_ENV
- - name: Install Qt (macOS)
- if: runner.os == 'macOS'
+ - name: Install Dependencies (Linux)
+ if: runner.os == 'Linux'
run: |
- brew update
- brew install qt@5 ninja
+ sudo apt-get -y update
+ sudo apt-get -y install ninja-build extra-cmake-modules
- - name: Update Qt (AppImage)
- if: runner.os == 'Linux' && matrix.appimage == true
+ - name: Install Dependencies (macOS)
+ if: runner.os == 'macOS'
run: |
- sudo add-apt-repository ppa:savoury1/qt-5-15
+ brew update
+ brew install ninja extra-cmake-modules
- name: Install Qt (Linux)
- if: runner.os == 'Linux'
+ if: runner.os == 'Linux' && matrix.appimage != true
run: |
- sudo apt-get -y update
- sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 ninja-build
+ sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 qt5-image-formats-plugins
+
+ - name: Install Qt (macOS and AppImage)
+ if: matrix.qt_ver == 6 && runner.os != 'Windows'
+ uses: jurplel/install-qt-action@v2
+ with:
+ version: ${{ matrix.qt_version }}
+ host: ${{ matrix.qt_host }}
+ target: 'desktop'
+ modules: ${{ matrix.qt_modules }}
+ aqtversion: ==2.1.*
- name: Prepare AppImage (Linux)
if: runner.os == 'Linux' && matrix.appimage == true
@@ -132,18 +166,18 @@ jobs:
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
run: |
- cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DQt5_DIR=/usr/local/opt/qt@5 -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@5 -DLauncher_BUILD_PLATFORM=macOS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja
+ cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DLauncher_BUILD_PLATFORM=macOS -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
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 }} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja
+ 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 }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: |
- cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=Linux -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja
+ cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=Linux -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja
##
# BUILD
@@ -161,6 +195,21 @@ jobs:
cmake --build ${{ env.BUILD_DIR }}
##
+ # TEST
+ ##
+
+ - name: Test
+ if: runner.os != 'Windows'
+ run: |
+ ctest --test-dir build --output-on-failure
+
+ - name: Test (Windows)
+ if: runner.os == 'Windows'
+ shell: msys2 {0}
+ run: |
+ ctest --test-dir build --output-on-failure
+
+ ##
# PACKAGE BUILDS
##
@@ -213,6 +262,13 @@ jobs:
cp -r ${{ env.INSTALL_DIR }} ${{ env.INSTALL_PORTABLE_DIR }} # cmake install on Windows is slow, let's just copy instead
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_PORTABLE_DIR }} --component portable
+ - name: Package (Windows, installer)
+ if: runner.os == 'Windows'
+ shell: msys2 {0}
+ run: |
+ cd ${{ env.INSTALL_DIR }}
+ makensis -NOCD "${{ github.workspace }}/${{ env.BUILD_DIR }}/program_info/win_install.nsi"
+
- name: Package (Linux)
if: runner.os == 'Linux' && matrix.appimage != true
run: |
@@ -241,11 +297,14 @@ jobs:
chmod +x linuxdeploy-*.AppImage
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-{8,17}-openjdk
+ mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
cp -r ${{ github.workspace }}/JREs/jre8/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-8-openjdk
cp -r ${{ github.workspace }}/JREs/jre17/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-17-openjdk
+ cp -r /home/runner/work/PolyMC/Qt/${{ matrix.qt_version }}/gcc_64/plugins/iconengines/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
+
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-8-openjdk/lib/amd64/server"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/jvm/java-8-openjdk/lib/amd64"
@@ -280,6 +339,13 @@ jobs:
name: PolyMC-${{ matrix.name }}-Portable-${{ env.VERSION }}-${{ inputs.build_type }}
path: ${{ env.INSTALL_PORTABLE_DIR }}/**
+ - name: Upload installer (Windows)
+ if: runner.os == 'Windows'
+ uses: actions/upload-artifact@v3
+ with:
+ name: PolyMC-${{ matrix.name }}-Setup-${{ env.VERSION }}-${{ inputs.build_type }}
+ path: PolyMC-Setup.exe
+
- name: Upload binary tarball (Linux)
if: runner.os == 'Linux' && matrix.appimage != true
uses: actions/upload-artifact@v3
diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
deleted file mode 100644
index f0f5b8cc..00000000
--- a/.github/workflows/pr-comment.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-name: Comment on pull request
-on:
- workflow_run:
- workflows: ['Build Application']
- types: [completed]
-jobs:
- pr_comment:
- if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/github-script@v5
- with:
- # This snippet is public-domain, taken from
- # https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
- script: |
- async function upsertComment(owner, repo, issue_number, purpose, body) {
- const {data: comments} = await github.rest.issues.listComments(
- {owner, repo, issue_number});
-
- const marker = `<!-- bot: ${purpose} -->`;
- body = marker + "\n" + body;
-
- const existing = comments.filter((c) => c.body.includes(marker));
- if (existing.length > 0) {
- const last = existing[existing.length - 1];
- core.info(`Updating comment ${last.id}`);
- await github.rest.issues.updateComment({
- owner, repo,
- body,
- comment_id: last.id,
- });
- } else {
- core.info(`Creating a comment in issue / PR #${issue_number}`);
- await github.rest.issues.createComment({issue_number, body, owner, repo});
- }
- }
-
- const {owner, repo} = context.repo;
- const run_id = ${{github.event.workflow_run.id}};
-
- const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
- if (!pull_requests.length) {
- return core.error("This workflow doesn't match any pull requests!");
- }
-
- const artifacts = await github.paginate(
- github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
- if (!artifacts.length) {
- return core.error(`No artifacts found`);
- }
- let body = `Download the artifacts for this pull request:\n`;
- for (const art of artifacts) {
- body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
- }
-
- core.info("Review thread message body:", body);
-
- for (const pr of pull_requests) {
- await upsertComment(owner, repo, pr.number,
- "nightly-link", body);
- }
diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml
index ff0d2b3f..2dbd5cd4 100644
--- a/.github/workflows/trigger_release.yml
+++ b/.github/workflows/trigger_release.yml
@@ -42,11 +42,14 @@ jobs:
for d in PolyMC-Windows-*; do
cd "${d}" || continue
- ARCH="$(echo -n ${d} | cut -d '-' -f 3)"
+ LEGACY="$(echo -n ${d} | grep -o Legacy || true)"
+ INST="$(echo -n ${d} | grep -o Setup || true)"
PORT="$(echo -n ${d} | grep -o Portable || true)"
- NAME="PolyMC-Windows-${ARCH}"
+ NAME="PolyMC-Windows"
+ test -z "${LEGACY}" || NAME="${NAME}-Legacy"
test -z "${PORT}" || NAME="${NAME}-Portable"
- zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" *
+ test -z "${INST}" || mv PolyMC-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe
+ test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" *
cd ..
done
@@ -66,7 +69,9 @@ jobs:
PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage
PolyMC-Windows-i686-${{ env.VERSION }}.zip
PolyMC-Windows-i686-Portable-${{ env.VERSION }}.zip
+ PolyMC-Windows-i686-Setup-${{ env.VERSION }}.exe
PolyMC-Windows-x86_64-${{ env.VERSION }}.zip
PolyMC-Windows-x86_64-Portable-${{ env.VERSION }}.zip
+ PolyMC-Windows-x86_64-Setup-${{ env.VERSION }}.exe
PolyMC-macOS-${{ env.VERSION }}.tar.gz
PolyMC-${{ env.VERSION }}.tar.gz
diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml
new file mode 100644
index 00000000..b8ecce13
--- /dev/null
+++ b/.github/workflows/winget.yml
@@ -0,0 +1,14 @@
+name: Publish to WinGet
+on:
+ release:
+ types: [released]
+
+jobs:
+ publish:
+ runs-on: windows-latest
+ steps:
+ - uses: vedantmgoyal2009/winget-releaser@latest
+ with:
+ identifier: PolyMC.PolyMC
+ installers-regex: '\.exe$'
+ token: ${{ secrets.WINGET_TOKEN }}