Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 59 additions & 65 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,68 @@ on:
push:
release:
types: [published]
workflow_dispatch:

jobs:
build:
strategy:
matrix:
qt_version: [5.14.2]
platform: [ubuntu-16.04, macos-latest, windows-latest]
platform: [ubuntu-22.04, macos-15-intel, windows-2022]
arch: [x86, x64]
include:
- platform: windows-latest
- platform: windows-2022
arch: x86
qtarch: win32_msvc2017
cmakearch: Win32
- platform: windows-latest
- platform: windows-2022
arch: x64
qtarch: win64_msvc2017_64
cmakearch: x64
exclude:
- platform: ubuntu-16.04
- platform: ubuntu-22.04
arch: x86
- platform: macos-latest
- platform: macos-15-intel
arch: x86
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- name: Checking out sources
uses: actions/checkout@v2
uses: actions/checkout@v5
with:
submodules: "recursive"
- name: Install MSVC compiler
uses: ilammy/msvc-dev-cmd@v1
with:
# 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo
toolset: 14.2
arch: ${{ matrix.arch }}
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: QtCache-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.qt_version }}
arch: ${{ matrix.arch }}
- name: Installing Qt - ${{ matrix.arch }}
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt_version }}
arch: ${{ matrix.qtarch }}
mirror: "http://mirrors.ocf.berkeley.edu/qt/"
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Install Python 3.7 version
if: matrix.platform == 'windows-latest'
uses: actions/setup-python@v1
extra: "-b http://mirrors.ocf.berkeley.edu/qt/"
cache: true
- name: Install Python 3.8 version
if: startsWith(matrix.platform, 'windows')
uses: actions/setup-python@v6
with:
python-version: "3.7"
python-version: "3.8"
architecture: ${{ matrix.arch }}
- name: Get the version
id: get_version
shell: bash
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> "$GITHUB_OUTPUT"
# Linux------------------------------------------
- name: Linux - Install packages
if: matrix.platform == 'ubuntu-16.04'
if: startsWith(matrix.platform, 'ubuntu')
shell: bash
env:
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
run: |
sudo apt install libgl-dev libx11-dev libxkbcommon-x11-dev ninja-build
- name: Linux - Build ecm
if: matrix.platform == 'ubuntu-16.04'
if: startsWith(matrix.platform, 'ubuntu')
shell: bash
env:
CC: /usr/bin/gcc-9
Expand All @@ -85,7 +78,7 @@ jobs:
cmake --build . --parallel $(nproc)
sudo cmake --build . --target install
- name: Linux - Build SyntaxHighlighting
if: matrix.platform == 'ubuntu-16.04'
if: startsWith(matrix.platform, 'ubuntu')
shell: bash
env:
CC: /usr/bin/gcc-9
Expand All @@ -98,7 +91,7 @@ jobs:
cmake --build . --parallel $(nproc)
sudo cmake --build . --target install
- name: Linux - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'ubuntu-16.04'
if: startsWith(matrix.platform, 'ubuntu')
shell: bash
env:
CC: /usr/bin/gcc-9
Expand All @@ -110,38 +103,39 @@ jobs:
cmake --build . --parallel $(nproc)
cmake --install .
- name: Linux - ${{ matrix.qt_version }} - Generating AppImage
if: matrix.platform == 'ubuntu-16.04'
if: startsWith(matrix.platform, 'ubuntu')
shell: bash
env:
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
run: |
cd build
wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage
chmod +x ./linuxdeployqt-6-x86_64.AppImage
./linuxdeployqt-6-x86_64.AppImage --appimage-extract
cd AppDir
wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-x86_64 -O AppRun
chmod a+x AppRun
mkdir -p ./usr/{lib,optional}/
wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so -O ./usr/optional/exec.so
mkdir -p ./usr/optional/libstdc++/
cp -fv /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./usr/optional/libstdc++/
mkdir -p ./usr/optional/libgcc_s/
cp -fv /lib/x86_64-linux-gnu/libgcc_s.so.1 ./usr/optional/libgcc_s/
cp -fv /usr/lib/x86_64-linux-gnu/{libssl.so.1.1,libcrypto.so.1.1} ./usr/lib/
cd ..
squashfs-root/AppRun AppDir/usr/share/applications/notepanda.desktop -appimage -no-strip -always-overwrite
# get linuxdeploy and linuxdeploy-plugin-checkrt and make them executable
wget -c "https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh"
wget -c "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod a+x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-checkrt.sh linuxdeploy-plugin-qt-x86_64.AppImage

# add GCC's libraries to the search path
# and call through linuxdeploy using the `--plugin checkrt` option
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--plugin checkrt \
--plugin qt \
--output appimage \
--icon-file ../images/panda.ico \
--desktop-file AppDir/usr/share/applications/notepanda.desktop

mv ./Notepanda*.AppImage ./Notepanda.AppImage
- name: Linux - ${{ matrix.qt_version }} - Uploading artifact
if: matrix.platform == 'ubuntu-16.04'
uses: actions/upload-artifact@master
if: startsWith(matrix.platform, 'ubuntu')
uses: actions/upload-artifact@v5
with:
name: Notepanda-${{ github.sha }}.Linux-${{ matrix.arch }}.qt${{ matrix.qt_version }}.AppImage
path: build/Notepanda.AppImage
- name: Linux - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'ubuntu-16.04' && matrix.qt_version == '5.14.2'
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release' && startsWith(matrix.platform, 'ubuntu') && matrix.qt_version == '5.14.2'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/Notepanda.AppImage
Expand All @@ -150,17 +144,17 @@ jobs:
overwrite: true
# Windows----------------------------------------------------------------------
# - name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Build preparation - Download Dependencies
# if: matrix.platform == 'windows-latest'
# if: startsWith(matrix.platform, 'windows')
# run: |
# choco install -y ninja
- name: Setup Ninja
if: matrix.platform == 'windows-latest'
uses: ashutoshvarma/setup-ninja@master
if: startsWith(matrix.platform, 'windows')
uses: ashutoshvarma/setup-ninja@66ad2db9ed7d211c065daeeb849e9c8c895773c9
with:
# ninja version to download. Default: 1.10.0
version: 1.10.0
- name: Win - Build ecm
if: matrix.platform == 'windows-latest'
if: startsWith(matrix.platform, 'windows')
env:
CC: cl.exe
CXX: cl.exe
Expand All @@ -173,7 +167,7 @@ jobs:
cmake --build . --parallel $(nproc)
cmake --build . --target install
- name: Win - Build syntax highlight
if: matrix.platform == 'windows-latest'
if: startsWith(matrix.platform, 'windows')
env:
CC: cl.exe
CXX: cl.exe
Expand All @@ -185,7 +179,7 @@ jobs:
cmake --build . --parallel $(nproc)
cmake --build . --target install
- name: Windows - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'windows-latest'
if: startsWith(matrix.platform, 'windows')
env:
CC: cl.exe
CXX: cl.exe
Expand All @@ -198,20 +192,20 @@ jobs:
cd Release
windeployqt notepanda.exe --no-translations
- name: Win - ${{ matrix.arch }} - ${{ matrix.qt_version }} - Create 7z Release
if: matrix.platform == 'windows-latest'
if: startsWith(matrix.platform, 'windows')
uses: DuckSoft/[email protected]
with:
pathSource: ./build/Release
pathTarget: ./release.7z
- name: Win - ${{ matrix.arch }} - ${{ matrix.qt_version }} - Uploading artifact
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@master
if: startsWith(matrix.platform, 'windows')
uses: actions/upload-artifact@v5
with:
name: Notepanda-${{ github.sha }}.Windows-${{ matrix.arch }}.qt${{ matrix.qt_version }}.7z
path: release.7z
- name: Win - ${{ matrix.arch }} - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'windows-latest' && matrix.qt_version == '5.14.2'
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release' && startsWith(matrix.platform, 'windows') && matrix.qt_version == '5.14.2'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release.7z
Expand All @@ -220,7 +214,7 @@ jobs:
overwrite: true
# MacOS ---------------------------------------------------------
- name: MacOS - Build ecm
if: matrix.platform == 'macos-latest'
if: startsWith(matrix.platform, 'macos')
shell: bash
run: |
brew install ninja
Expand All @@ -231,7 +225,7 @@ jobs:
cmake --build .
cmake --build . --target install
- name: MacOS - Build syntax highlight
if: matrix.platform == 'macos-latest'
if: startsWith(matrix.platform, 'macos')
run: |
cd src/3rdparty/syntax-highlighting
mkdir build
Expand All @@ -240,7 +234,7 @@ jobs:
cmake --build .
sudo cmake --build . --target install
- name: macOS - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'macos-latest'
if: startsWith(matrix.platform, 'macos')
run: |
mkdir build
cd build
Expand All @@ -249,14 +243,14 @@ jobs:
sudo cmake --install .
macdeployqt notepanda.app -dmg
- name: macOS - ${{ matrix.qt_version }} - Uploading Artifact
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@master
if: startsWith(matrix.platform, 'macos')
uses: actions/upload-artifact@v5
with:
name: Notepanda-${{ github.sha }}.macOS-${{ matrix.arch }}.qt${{ matrix.qt_version }}.dmg
path: build/notepanda.dmg
- name: macOS - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'macos-latest' && matrix.qt_version == '5.14.2'
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release' && startsWith(matrix.platform, 'macos') && matrix.qt_version == '5.14.2'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/notepanda.dmg
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: "Check Clang Format"

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
format:
name: "Check Clang Format"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: "Install clang-format-9"
- uses: actions/checkout@v5
- name: "Install clang-format"
run: |
sudo apt-get update
sudo apt-get install clang-format-9
sudo apt-get install clang-format
- name: "Format Codes"
run: clang-format-9 -i src/*.cpp src/*/*.cpp src/*/*.h
run: clang-format -i src/*.cpp src/*/*.cpp src/*/*.h
- name: Check diff
run: git diff --exit-code HEAD
- name: Create Pull Request
if: failure()
uses: peter-evans/create-pull-request@v2
uses: peter-evans/create-pull-request@v7
with:
commit-message: "style: format codes"
title: "style: format codes for ${{ github.ref }}"
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/cpack-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,37 @@ on:
push:
release:
types: [published]
workflow_dispatch:

jobs:
check_commit_msg:
outputs:
commit_message: ${{ steps.get_message.outputs.message }}
name: Check if the workflow has been disabled.
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v5
- name: Get commit message
id: get_message
run: |
echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.event.after }})"
echo "::set-env name=message::$(git log --format=%B -n 1 ${{ github.event.after }})"
{
echo 'message<<EOF'
git log --format=%B -n 1 ${{ github.event.after }}
echo EOF
} >> "$GITHUB_OUTPUT"
{
echo 'message<<EOF'
git log --format=%B -n 1 ${{ github.event.after }}
echo EOF
} >> "$GITHUB_ENV"
linux:
strategy:
matrix:
distro: [stable]
needs: check_commit_msg
if: ${{ !contains( needs.check_commit_msg.outputs.commit_message, 'NO_DEB') }}
name: Debian ${{ matrix.distro }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container: debian:${{ matrix.distro }}

steps:
Expand All @@ -34,7 +43,7 @@ jobs:
apt-get update
apt-get install -y git
- name: Checking out sources
uses: actions/checkout@v2
uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Install build dependencies
Expand All @@ -50,18 +59,18 @@ jobs:
shell: bash
id: get_package
run: |
echo ::set-output name=NAME::$(basename build/Notepanda-*.deb)
echo "NAME=$(basename build/Notepanda-*.deb)" >> "$GITHUB_OUTPUT"
- name: Get the version
id: get_version
shell: bash
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v2-preview
uses: actions/upload-artifact@v5
with:
name: ${{ steps.get_package.outputs.NAME }}
path: build/${{ steps.get_package.outputs.NAME }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release' && matrix.distro == 'stable'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading