Skip to content

Commit

Permalink
Merge branch 'master' into color_layer_ver2
Browse files Browse the repository at this point in the history
  • Loading branch information
J5lx committed Feb 15, 2025
2 parents be5013a + 72cf028 commit bf83af2
Show file tree
Hide file tree
Showing 495 changed files with 101,262 additions and 44,475 deletions.
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "🐛 Bug Report"
description: Create a new ticket for a bug.
title: "🐛 [BUG] - <title>"
labels: [
"Bug"
]
body:
- type: input
attributes:
label: Pencil2D version
placeholder: 0.7.0
description: Look at Title bar or "About" dialog
validations:
required: true
- type: dropdown
attributes:
label: Operating System
description: The operating system you are using
options:
- Windows
- MacOS
- Linux
- Other (please specify in the description)
validations:
required: true
- type: textarea
id: reproduce-steps
attributes:
label: "Steps to reproduce"
description: We highly suggest including screenshots or a detailed error log.
placeholder: "Having detailed steps helps us reproduce the bug."
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: "Expected Behaviour"
description: What were you expecting?
placeholder: e.g., I expected that the paint bucket filled everything red on the vector layer
validations:
required: true
- type: textarea
id: actual-behaviour
attributes:
label: "Actual Behaviour"
description: What happened instead?
placeholder: e.g., the paint bucket only changed the color of the stroke
validations:
required: true
- type: textarea
id: other-info
attributes:
label: "Other Information"
placeholder: |
- Do you use a drawing tablet? <Insert tablet name if applicable>
- A screenshot or short video to show your problem.
validations:
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Pencil2D forums
url: https://discuss.pencil2d.org/
about: A place to discuss issues, share knowledge, showcase animations or request features.
- name: Discord
url: https://discord.com/invite/8FxdV2g
about: Our primary communication and support channel. Most of the contributors hang around here.
2 changes: 1 addition & 1 deletion .github/actions/create-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ runs:
RUNNER_OS: ${{runner.os}}
INPUT_ARCH: ${{inputs.arch}}
INPUT_QT: ${{inputs.qt}}
IS_RELEASE: ${{ github.ref == 'refs/heads/release' }}
IS_RELEASE: ${{ startsWith(github.ref, 'refs/heads/release/') }}
120 changes: 88 additions & 32 deletions .github/actions/create-package/create-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,55 @@
trap 'echo "::error::Command failed"' ERR
set -eE

harvest_files() {
echo "<?xml version='1.0' encoding='utf-8'?>"
echo "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>"
echo " <Fragment>"
echo " <ComponentGroup Id='$1' Directory='INSTALLDIR'>"

while IFS= read -r filepath; do
local subdirectory="$(dirname "${filepath}")"
if [ "${subdirectory}" = "." ]; then
echo " <Component>"
else
echo " <Component Subdirectory='${subdirectory}'>"
fi
echo " <File Source='${filepath}' />"
echo " </Component>"
done

echo " </ComponentGroup>"
echo " </Fragment>"
echo "</Wix>"
}

create_package_linux() {
echo "::group::Set up AppImage contents"
make install INSTALL_ROOT="${PWD}/Pencil2D"
${BUILD_CMD} make -C build install INSTALL_ROOT="/workspace/Pencil2D"
echo "::endgroup::"

echo "::group::Create AppImage"
# "Downgrade" the desktop entry to version 1.0
sed -i "/^Keywords\(\[[a-zA-Z_.@]\+\]\)\?=/d;/^Version=/cVersion=1.0" \
${BUILD_CMD} sed -i "/^Keywords\(\[[a-zA-Z_.@]\+\]\)\?=/d;/^Version=/cVersion=1.0" \
Pencil2D/usr/share/applications/org.pencil2d.Pencil2D.desktop
install -Dm755 /usr/bin/ffmpeg Pencil2D/usr/plugins/ffmpeg
install -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" \
${BUILD_CMD} install -Dm755 /usr/bin/ffmpeg Pencil2D/usr/plugins/ffmpeg
${BUILD_CMD} install -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" \
"Pencil2D/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
local gst_executables="-executable=Pencil2D/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
for plugin in adpcmdec alsa app audioconvert audioparsers audioresample \
autodetect coreelements gsm id3demux jack mpg123 mulaw playback \
pulse typefindfunctions wavparse apetag; do
install -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgst${plugin}.so" \
${BUILD_CMD} install -Dm755 "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgst${plugin}.so" \
"Pencil2D/usr/lib/gstreamer-1.0/libgst${plugin}.so"
gst_executables="${gst_executables} -executable=Pencil2D/usr/lib/gstreamer-1.0/libgst${plugin}.so"
done
curl -fsSLO https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod 755 linuxdeployqt-continuous-x86_64.AppImage
${BUILD_CMD} curl -fsSLO https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
${BUILD_CMD} chmod 755 linuxdeployqt-continuous-x86_64.AppImage
local update_info="" # Currently no appimageupdate support for nightly builds
if [ $IS_RELEASE = "true" ]; then
update_info="-updateinformation=gh-releases-zsync|${GITHUB_REPOSITORY/\//|}|latest|pencil2d-linux-amd64-*.AppImage.zsync"
update_info="-updateinformation=\"gh-releases-zsync|${GITHUB_REPOSITORY/\//|}|latest|pencil2d-linux-amd64-*.AppImage.zsync\""
fi
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu/pulseaudio" \
${BUILD_CMD} bash -c "LD_LIBRARY_PATH=\"\${LD_LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu/pulseaudio\" \
./linuxdeployqt-continuous-x86_64.AppImage \
Pencil2D/usr/share/applications/org.pencil2d.Pencil2D.desktop \
-executable=Pencil2D/usr/plugins/ffmpeg \
Expand All @@ -38,11 +60,11 @@ create_package_linux() {
platforms/libqwayland-xcomposite-egl.so,platforms/libqwayland-xcomposite-glx.so,\
wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration \
${update_info} \
-appimage
-appimage"
local qtsuffix="-qt${INPUT_QT}"
local output_name="pencil2d${qtsuffix/-qt5/}-linux-$1-$(date +%F)"
mv Pencil2D*.AppImage "$output_name.AppImage"
mv Pencil2D*.AppImage.zsync "$output_name.AppImage.zsync" \
local output_name="pencil2d${qtsuffix/-qt5/}-linux-$3"
mv "${GITHUB_WORKSPACE}"/Pencil2D*.AppImage "$output_name.AppImage"
mv "${GITHUB_WORKSPACE}"/Pencil2D*.AppImage.zsync "$output_name.AppImage.zsync" \
&& sed -i '1,/^$/s/^\(Filename\|URL\): .*$/\1: '"$output_name.AppImage/" "$output_name.AppImage.zsync" \
|| true
echo "output-basename=$output_name" >> "${GITHUB_OUTPUT}"
Expand Down Expand Up @@ -72,20 +94,16 @@ create_package_macos() {
echo "::group::Deploy Qt libraries"
macdeployqt Pencil2D.app
echo "::endgroup::"
echo "::group::Apply macdeployqt fix"
curl -fsSLO https://github.com/aurelien-rainone/macdeployqtfix/archive/master.zip
bsdtar xf master.zip
python macdeployqtfix-master/macdeployqtfix.py \
Pencil2D.app/Contents/MacOS/Pencil2D \
/usr/local/Cellar/qt/5.9.1/
echo "::endgroup::"
echo "Remove files"
rm -rf macdeployqtfix-master master.zip

popd >/dev/null
echo "Create ZIP"
local qtsuffix="-qt${INPUT_QT}"
bsdtar caf "pencil2d${qtsuffix/-qt5/}-mac-$1-$(date +%F).zip" Pencil2D
echo "output-basename=pencil2d${qtsuffix/-qt5/}-mac-$1-$(date +%F)" > "${GITHUB_OUTPUT}"
local arch=`uname -m`
local fileinfo="${qtsuffix/-qt5/}-mac-${arch}-$3"
mv Pencil2D "pencil2d${fileinfo}"
ditto -c -k --sequesterRsrc --keepParent "pencil2d${fileinfo}" "pencil2d${fileinfo}.zip"
rm -r "pencil2d${fileinfo}"
echo "output-basename=pencil2d${fileinfo}" > "${GITHUB_OUTPUT}"
}

create_package_windows() {
Expand All @@ -104,19 +122,57 @@ create_package_windows() {

echo "Remove files"
find \( -name '*.pdb' -o -name '*.ilk' \) -delete
echo "::group::Deploy Qt libraries"
windeployqt Pencil2D/pencil2d.exe
echo "::endgroup::"
echo "Deploy Qt libraries"
# windeployqt lists some translation files that it doesn't actually copy, and the MSVC redistributable is handled by the bundle, so skip those
windeployqt --list relative Pencil2D/pencil2d.exe | grep -v '^translations\\qtbase_' | grep -v '^translations\\qtmultimedia_' | grep -v '^vc_' | harvest_files windeployqt > windeployqt.wxs
echo "Copy OpenSSL DLLs"
curl -fsSLO https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-1.1.1w.zip
"${WINDIR}\\System32\\tar" xf openssl-1.1.1w.zip
local xbits="x${platform#win}"
local _xbits="-${xbits}"
local wordsize="${platform#win}"
local xbits="x${wordsize}"
local _xbits="-x${wordsize}"
cp "openssl-1.1\\${xbits/32/86}\\bin\\lib"{ssl,crypto}"-1_1${_xbits/-x32/}.dll" Pencil2D/
echo "::group::Create Installer"
env -C ../util/installer qmake CONFIG-=debug_and_release CONFIG+=release
env -C ../util/installer "PATH=${PATH/\/usr\/bin:/}" nmake
env -C Pencil2D find resources/ -type f | harvest_files resources > resources.wxs
for i in ../util/installer/translations/pencil2d_*.wxl.xlf; do
local basename="$(basename -s .wxl.xlf "$i")"
local locale="${basename#*_}"
local culture="${locale/_/-}"
local lcid="$(pwsh -c "(Get-Culture -Name ${culture}).LCID")"
sed "s/Culture=\"en\"/Culture=\"${culture}\"/;s/Language=\"9\"/Language=\"${lcid}\"/" ../util/installer/pencil2d.wxl > "../util/installer/pencil2d_${locale}.wxl"
tikal.bat -m -fc ../util/installer/okf_xml_wxl -ie utf-8 -oe utf-8 -sd ../util/installer -od ../util/installer "${i}"
done
local versiondefines="-d Edition=Nightly -d NightlyBuildNumber=$1 -d NightlyBuildTimestamp=$(date +%F)"
if [ "$IS_RELEASE" = "true" ]; then
versiondefines="-d Edition=Release -d Version=$2"
fi
wix build -pdbtype none -arch "x${wordsize/32/86}" -dcl high -b ../util/installer -b Pencil2D \
-d "ProductCode=$(python -c "import uuid; print(str(uuid.uuid5(uuid.NAMESPACE_URL, '-Nhttps://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}#${platform}')).upper())")" \
$versiondefines \
-out "pencil2d-${platform}-$3.msi" \
../util/installer/pencil2d.wxs windeployqt.wxs resources.wxs
wix build -pdbtype none -arch "x${wordsize/32/86}" -dcl high -sw1133 -b ../util/installer -b Pencil2D \
-ext WixToolset.Util.wixext -ext WixToolset.BootstrapperApplications.wixext \
$versiondefines \
-out "pencil2d-${platform}-$3.exe" \
../util/installer/pencil2d.bundle.wxs
echo "::endgroup::"
echo "Create ZIP"
local qtsuffix="-qt${INPUT_QT}"
"${WINDIR}\\System32\\tar" caf "pencil2d${qtsuffix/-qt5/}-${platform}-$1-$(date +%F).zip" Pencil2D
echo "output-basename=pencil2d${qtsuffix/-qt5/}-${platform}-$1-$(date +%F)" > "${GITHUB_OUTPUT}"
"${WINDIR}\\System32\\tar" caf "pencil2d${qtsuffix/-qt5/}-${platform}-$3.zip" Pencil2D
# This basename pattern deliberately does not include the installer for the Qt 6 build.
# Should this ever be changed so that more than one installer is uploaded per workflow run,
# absolutely make sure not to break any Windows Installer rules.
echo "output-basename=pencil2d${qtsuffix/-qt5/}-${platform}-$3" > "${GITHUB_OUTPUT}"
}

"create_package_$(echo $RUNNER_OS | tr '[A-Z]' '[a-z]')" "${GITHUB_RUN_NUMBER}"
echo "Version: ${VERSION_NUMBER}"

filename_suffix="b${GITHUB_RUN_NUMBER}-$(date +%F)"
if [ "$IS_RELEASE" = "true" ]; then
filename_suffix="${VERSION_NUMBER}"
fi

"create_package_$(echo $RUNNER_OS | tr '[A-Z]' '[a-z]')" "${GITHUB_RUN_NUMBER}" "${VERSION_NUMBER}" "${filename_suffix}"
12 changes: 6 additions & 6 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ inputs:
runs:
using: composite
steps:
- run: ${GITHUB_ACTION_PATH}/install-dependencies.sh
shell: bash
env:
RUNNER_OS: ${{runner.os}}
INPUT_ARCH: ${{inputs.arch}}
INPUT_QT: ${{inputs.qt}}
- if: runner.os == 'Windows'
uses: jurplel/install-qt-action@v3
with:
arch: ${{inputs.arch}}
version: ${{matrix.qt == 6 && '6.4.2' || '5.15.2'}}
modules: ${{matrix.qt == 6 && 'qtmultimedia' || ''}}
- run: ${GITHUB_ACTION_PATH}/install-dependencies.sh
shell: bash
env:
RUNNER_OS: ${{runner.os}}
INPUT_ARCH: ${{inputs.arch}}
INPUT_QT: ${{inputs.qt}}
23 changes: 16 additions & 7 deletions .github/actions/install-dependencies/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,34 @@
setup_linux() {
# Because of how bare-bones our docker image is
echo "::group::Install prerequisites"
apt-get -yq install software-properties-common
${BUILD_CMD} apt-get -yq update
${BUILD_CMD} apt-get -yq install software-properties-common
echo "::endgroup::"

echo "::group::Add APT sources"
for ppa in ppa:ubuntu-toolchain-r/test ppa:ubuntu-sdk-team/ppa \
ppa:git-core/ppa; do
apt-add-repository -y "${ppa}"
${BUILD_CMD} apt-add-repository -y "${ppa}"
done
if [ "${INPUT_QT}" -eq 5 ]; then
apt-add-repository -y ppa:beineri/opt-qt-5.15.2-xenial
${BUILD_CMD} apt-add-repository -y ppa:beineri/opt-qt-5.15.2-xenial
fi
echo "::endgroup::"

echo "::group::Fetch APT updates"
apt-get update -yq
${BUILD_CMD} apt-get update -yq
echo "::endgroup::"

echo "::group::Install APT packages"
if [ "${INPUT_QT}" -eq 5 ]; then
apt-get install -yq --no-install-suggests --no-install-recommends \
${BUILD_CMD} apt-get install -yq --no-install-suggests --no-install-recommends \
build-essential qt515tools qt515base qt515multimedia qt515svg \
qt515wayland libgl1-mesa-dev bsdtar ffmpeg gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly gstreamer1.0-alsa gstreamer1.0-pulseaudio git \
curl libfuse2
else
apt-get install -yq --no-install-suggests --no-install-recommends \
${BUILD_CMD} apt-get install -yq --no-install-suggests --no-install-recommends \
build-essential qt6-l10n-tools qt6-base-dev qt6-multimedia-dev \
libqt6svg6-dev qt6-wayland-dev libgl1-mesa-dev libarchive-tools ffmpeg \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
Expand All @@ -51,7 +52,15 @@ setup_macos() {
}

setup_windows() {
: # Nothing to do here
pip install translate-toolkit[rc]
curl -fsSLO https://okapiframework.org/binaries/main/1.45.0/okapi-apps_win32-x86_64_1.45.0.zip
mkdir okapi
"${WINDIR}\\System32\\tar" xfC okapi-apps_win32-x86_64_1.45.0.zip okapi
dotnet tool install -g wix --version 5.0.0
wix extension add -g WixToolset.Util.wixext/5.0.0 WixToolset.BootstrapperApplications.wixext/5.0.0
nuget install -x -OutputDirectory util/installer WixToolset.DUtil -Version 5.0.0
nuget install -x -OutputDirectory util/installer WixToolset.BootstrapperApplicationApi -Version 5.0.0
nuget install -x -OutputDirectory util/installer WixToolset.WixStandardBootstrapperApplicationFunctionApi -Version 5.0.0
}

"setup_$(echo "${RUNNER_OS}" | tr '[A-Z]' '[a-z]')"
2 changes: 2 additions & 0 deletions .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ runs:
env:
RUNNER_OS: ${{runner.os}}
INPUT_ARCH: ${{inputs.arch}}
- run: ${GITHUB_ACTION_PATH}/setup-versions.sh
shell: bash
10 changes: 5 additions & 5 deletions .github/actions/setup-environment/setup-environment.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env bash

setup_linux() {
echo "MAKEFLAGS=-j2" >> "${GITHUB_ENV}"
echo "MAKEFLAGS=-j2" >> "${GITHUB_WORKSPACE}/env"
# Our container image uses the non-Unicode C locale by default
echo "LANG=C.UTF-8" >> "${GITHUB_ENV}"
echo "LANG=C.UTF-8" >> "${GITHUB_WORKSPACE}/env"
# Set up Qt environment variables and export them to the GitHub Actions workflow
if [ -f /opt/qt515/bin/qt515-env.sh ]; then
(printenv; (. /opt/qt515/bin/qt515-env.sh; printenv)) | sort -st= -k1,1 | uniq -u >> "${GITHUB_ENV}"
fi
${BUILD_CMD} bash -c 'if [ -f /opt/qt515/bin/qt515-env.sh ]; then (printenv; (. /opt/qt515/bin/qt515-env.sh; printenv)); fi' | sort -st= -k1,1 | uniq -u >> "${GITHUB_WORKSPACE}/env"
}

setup_macos() {
Expand All @@ -19,6 +17,8 @@ setup_windows() {
local platform="${INPUT_ARCH%%_*}"
local vcvars="C:\\Program^ Files^ ^(x86^)\\Microsoft^ Visual^ Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars${platform#win}.bat"
($(which cmd) //c set; $(which cmd) //c "${vcvars} 2>&1>nul && set") | sort -st= -k1,1 | uniq -u >> "${GITHUB_ENV}"
echo "${JAVA_HOME_17_X64}\\bin" >> "${GITHUB_PATH}"
realpath okapi/ >> "${GITHUB_PATH}"
}

"setup_$(echo "${RUNNER_OS}" | tr '[A-Z]' '[a-z]')"
16 changes: 16 additions & 0 deletions .github/actions/setup-environment/setup-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# set env.VERSION_NUMBER from release branch names e.g., release/0.7.0
if [[ "${GITHUB_REF_NAME}" == "release/"* ]]; then
branchVerion=$(echo "${GITHUB_REF_NAME}" | sed 's/release\///')
VERSION_NUMBER="$branchVerion.${GITHUB_RUN_NUMBER}"
echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV
echo "VERSION_NUMBER is $VERSION_NUMBER"
fi

# set env.VERSION_NUMBER to 99.0.0.buildNumber if the branch is master
if [ "${GITHUB_REF_NAME}" = "master" ]; then
VERSION_NUMBER=99.0.0.${GITHUB_RUN_NUMBER}
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> "${GITHUB_ENV}"
echo "VERSION_NUMBER is $VERSION_NUMBER"
fi
Loading

0 comments on commit bf83af2

Please sign in to comment.