Skip to content

Commit

Permalink
Merge branch 'aseprite:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RooTender authored Jun 21, 2024
2 parents fa9638b + 32a099d commit a64eb6e
Show file tree
Hide file tree
Showing 157 changed files with 2,020 additions and 1,039 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Checks: >
portability-*,
readability-*,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions,
-misc-use-anonymous-namespace,
-readability-braces-around-statements,
-readability-function-cognitive-complexity,
Expand Down
83 changes: 62 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,50 @@ jobs:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
build_type: [RelWithDebInfo, Debug]
enable_ui: [off]
include:
- os: ubuntu-latest
build_type: Debug
enable_ui: on
ui: [gui, cli]
scripting: [lua, noscripts]
exclude:
- build_type: Debug
ui: gui
- build_type: RelWithDebInfo
ui: cli
- build_type: RelWithDebInfo
scripting: noscripts
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Dependencies
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get install -y \
libpixman-1-dev libfreetype6-dev libharfbuzz-dev zlib1g-dev \
libx11-dev libxcursor-dev libxi-dev libgl1-mesa-dev
- name: Install Skia
if: ${{ matrix.ui == 'gui' }}
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]] ; then
choco install wget -y --no-progress
wget https://github.com/aseprite/skia/releases/download/m102-861e4743af/Skia-Windows-Release-x64.zip
unzip Skia-Windows-Release-x64.zip -d skia
elif [[ "${{ runner.os }}" == "macOS" ]] ; then
wget https://github.com/aseprite/skia/releases/download/m102-861e4743af/Skia-macOS-Release-arm64.zip
unzip Skia-macOS-Release-arm64.zip -d skia
else
wget https://github.com/aseprite/skia/releases/download/m102-861e4743af/Skia-Linux-Release-x64-libstdc++.zip
unzip Skia-Linux-Release-x64-libstdc++.zip -d skia
fi
- name: ccache
uses: hendrikmuhs/ccache-action@v1
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
with:
key: ${{ matrix.os }}-${{ matrix.enable_ui }}-${{ matrix.build_type }}
- uses: turtlesec-no/get-ninja@main
key: ${{ matrix.os }}-${{ matrix.ui }}-${{ matrix.scripting }}-${{ matrix.build_type }}
- uses: aseprite/get-ninja@main
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: Workaround for windows-2022 and cmake 3.25.0
if: runner.os == 'Windows'
shell: bash
run: rm -rf C:/Strawberry/
- name: Install Dependencies
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]] ; then
sudo apt-get update -qq
sudo apt-get install -y \
libx11-dev libxcursor-dev libxi-dev
fi
- name: Generating Makefiles
shell: bash
run: |
Expand All @@ -45,12 +60,37 @@ jobs:
else
export enable_ccache=on
fi
if [[ "${{ matrix.ui }}" == "gui" ]] ; then
export enable_ui=on
export laf_backend=skia
else
export enable_ui=off
export laf_backend=none
fi
if [[ "${{ matrix.scripting }}" == "lua" ]] ; then
export enable_scripting=on
else
export enable_scripting=off
fi
if [[ "${{ runner.os }}" == "macOS" ]] ; then
export skia_arch=arm64
else
export skia_arch=x64
fi
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-DENABLE_TESTS=ON \
-DENABLE_UI=${{ matrix.enable_ui }} \
-DENABLE_CCACHE=$enable_ccache
-DENABLE_UI=$enable_ui \
-DENABLE_SCRIPTING=$enable_scripting \
-DENABLE_CCACHE=$enable_ccache \
-DLAF_BACKEND=$laf_backend \
-DSKIA_DIR=skia \
-DSKIA_LIBRARY_DIR=skia/out/Release-$skia_arch
- name: Compiling
shell: bash
run: |
Expand All @@ -63,6 +103,7 @@ jobs:
fi
cd build && $XVFB ctest --output-on-failure
- name: Running CLI Tests
if: ${{ matrix.scripting == 'lua' }}
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]] ; then
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/lint_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Based on SerenityOS commit linter:
# https://github.com/SerenityOS/serenity/blob/master/.github/workflows/lintcommits.yml

name: Commit linter
on: [pull_request_target]
jobs:
lint_commits:
runs-on: ubuntu-22.04
if: always() && github.repository == 'aseprite/aseprite'
steps:
- name: Lint PR commits
uses: actions/github-script@v7
with:
script: |
const rules = [
{
pattern: /^[^\r]*$/,
error: "Commit message contains CRLF line breaks (only unix-style LF linebreaks are allowed)",
},
{
pattern: /^.+(\r?\n(\r?\n.*)*)?$/,
error: "Empty line between commit title and body is missing",
},
{
pattern: /^.{0,72}(?:\r?\n(?:(.{0,72})|(.*?([a-z]+:\/\/)?(([a-zA-Z0-9_]|-)+\.)+[a-z]{2,}(:\d+)?([a-zA-Z_0-9@:%\+.~\?&/=]|-)+).*?))*$/,
error: "Commit message lines are too long (maximum allowed is 72 characters, except for URLs)",
},
{
pattern: /^.+[^.\n](\r?\n.*)*$/,
error: "Commit title ends in a period",
},
{
pattern: /^((?!Signed-off-by: )[\s\S])*$/,
error: "Commit body contains a Signed-off-by tag",
},
];
const { repository, pull_request } = context.payload;
// NOTE: This maxes out at 250 commits. If this becomes a problem, see:
// https://octokit.github.io/rest.js/v18#pulls-list-commits
const opts = github.rest.pulls.listCommits.endpoint.merge({
owner: repository.owner.login,
repo: repository.name,
pull_number: pull_request.number,
});
const commits = await github.paginate(opts);
const errors = [];
for (const { sha, commit: { message } } of commits) {
const commitErrors = [];
for (const { pattern, error } of rules) {
if (!pattern.test(message)) {
commitErrors.push(error);
}
}
if (commitErrors.length > 0) {
const title = message.split("\n")[0];
errors.push([`${title} (${sha}):`, ...commitErrors].join("\n "));
}
}
if (errors.length > 0) {
core.setFailed(`One or more of the commits in this PR do not match the code submission policy:\n\n${errors.join("\n")}`);
}
- name: Comment on PR
if: ${{ failure() && !github.event.pull_request.draft }}
uses: IdanHo/comment-on-pr@63ea2bf352997c66e524b8b5be7a79163fb3a88a
env:
GITHUB_TOKEN: ${{ secrets.LINT_COMMIT_TOKEN }}
with:
msg: "Hi there!\n\nOne or more of the commit messages in this PR do not match our [code submission policy](https://github.com/aseprite/aseprite/blob/main/CONTRIBUTING.md), please check the `lint_commits` CI job for more details on which commits were flagged and why.\nPlease do not close this PR and open another, instead modify your commit message(s) with [git commit --amend](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message) and force push those changes to update this PR."
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,18 @@ else()
set(REQUIRE_CURL OFF)
endif()

# Select libcurl's TLS backend according to target platform
if(REQUIRE_CURL AND ENABLE_DRM)
if(APPLE)
option(CMAKE_USE_SECTRANSP "enable Apple OS native SSL/TLS" ON)
endif()
# SSL/TLS support
if(REQUIRE_CURL AND NOT USE_SHARED_CURL)
# Disable OpenSSL (use native libraries only)
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
set(CMAKE_USE_LIBSSH2 OFF CACHE BOOL "Use libSSH2")

if(WIN32)
set(CMAKE_USE_SCHANNEL "enable Windows native SSL/TLS" ON)
set(CMAKE_USE_SCHANNEL ON CACHE BOOL "enable Windows native SSL/TLS")
elseif(APPLE)
set(CMAKE_USE_SECTRANSP ON CACHE BOOL "enable Apple OS native SSL/TLS")
else()
# TODO Linux?
endif()
endif()

Expand Down Expand Up @@ -293,7 +298,7 @@ if(USE_SHARED_CMARK)
find_path(CMARK_INCLUDE_DIRS NAMES cmark.h)
else()
add_definitions(-DCMARK_STATIC_DEFINE)
set(CMARK_LIBRARIES cmark_static)
set(CMARK_LIBRARIES cmark)
endif()

if(REQUIRE_CURL)
Expand Down
Loading

0 comments on commit a64eb6e

Please sign in to comment.