CI: Added creation of release when pushing a tag #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
ubuntu: | |
name: Ubuntu ${{ matrix.ubuntu_version }} (Qt ${{ matrix.qt_version }}) | |
runs-on: ubuntu-${{ matrix.ubuntu_version }} | |
strategy: | |
matrix: | |
include: | |
- ubuntu_version: 22.04 | |
qt_version: 5 | |
qt_package: qtbase5-dev | |
- ubuntu_version: 24.04 | |
qt_version: 6 | |
qt_package: qt6-base-dev | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Update submodules | |
run: ./update-submodules.sh --minimal | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
max-size: 50M | |
- name: Install dependencies | |
run: | | |
sudo apt-get install \ | |
${{ matrix.qt_package }} \ | |
libfreetype-dev \ | |
libgl1-mesa-dev \ | |
libharfbuzz-dev \ | |
libpixman-1-dev \ | |
libxcursor-dev \ | |
libxi-dev \ | |
zlib1g-dev | |
- name: Build | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=Release \ | |
-DUSE_SHARED_ZLIB=on \ | |
-DUSE_SHARED_LIBPNG=on \ | |
-DUSE_SHARED_PIXMAN=on \ | |
-DUSE_SHARED_FREETYPE=on \ | |
-DUSE_SHARED_HARFBUZZ=on | |
cmake --build build --config Release | |
sudo cmake --install build --config Release | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ubuntu-${{ matrix.ubuntu_version }}-qt-${{ matrix.qt_version }} | |
path: build/libqaseprite.so | |
macos: | |
name: macOS ${{ matrix.macos_version }} (Qt ${{ matrix.qt_version }}) | |
runs-on: macos-${{ matrix.macos_version }} | |
strategy: | |
matrix: | |
include: | |
- macos_version: 14 | |
qt_version: 5.15.2 | |
architectures: x86_64 | |
- macos_version: 15 | |
qt_version: 6.8.1 | |
architectures: x86_64;arm64 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Update submodules | |
run: ./update-submodules.sh --no-zlib | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
max-size: 50M | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{ matrix.qt_version }} | |
arch: clang_64 | |
cache: true | |
- name: Build | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=Release \ | |
-DUSE_SHARED_ZLIB=on \ | |
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architectures }}' | |
cmake --build build --config Release | |
sudo cmake --install build --config Release | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-${{ matrix.macos_version }}-qt-${{ matrix.qt_version }} | |
path: build/libqaseprite.so | |
windows: | |
name: Windows (Qt ${{ matrix.qt_version }}, ${{ matrix.qt_arch }}) | |
runs-on: windows-${{ matrix.windows_version }} | |
strategy: | |
matrix: | |
include: | |
- windows_version: 2019 | |
qt_version: 5.15.2 | |
qt_arch: win32_msvc2019 | |
cmake_args: -G "Visual Studio 16 2019" -A Win32 | |
artifact_path: build/Release/qaseprite.dll | |
- windows_version: 2022 | |
qt_version: 6.8.1 | |
qt_arch: win64_msvc2022_64 | |
cmake_args: -G "Visual Studio 17 2022" -A x64 | |
artifact_path: build/Release/qaseprite.dll | |
- windows_version: 2019 | |
qt_version: 5.15.2 | |
qt_arch: win32_mingw81 | |
qt_tools: tools_mingw,qt.tools.win32_mingw810 | |
cmake_args: -G "MinGW Makefiles" | |
artifact_path: build/libqaseprite.dll | |
- windows_version: 2022 | |
qt_version: 6.8.1 | |
qt_arch: win64_mingw | |
qt_tools: tools_mingw1310,qt.tools.win64_mingw1310 | |
cmake_args: -G "MinGW Makefiles" | |
artifact_path: build/libqaseprite.dll | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Update submodules | |
run: ./update-submodules.sh | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{ matrix.qt_version }} | |
arch: ${{ matrix.qt_arch }} | |
tools: "${{ matrix.qt_tools }}" | |
cache: true | |
- name: Build | |
run: | | |
pushd aseprite/laf | |
patch -p1 < ../../laf-msvc-dynamic-runtime.patch | |
popd | |
cmake -B build -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_args }} | |
cmake --build build --config Release | |
cmake --install build --config Release | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.qt_arch }}-qt-${{ matrix.qt_version }} | |
path: ${{ matrix.artifact_path }} | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: [ubuntu, macos, windows] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create source archive | |
run: | | |
./update-submodules.sh | |
pushd aseprite/laf | |
patch -p1 < ../../laf-msvc-dynamic-runtime.patch | |
popd | |
./create-source-archive.sh ${{ github.ref_name }} | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Compress each artifact | |
run: | | |
for file in ./artifacts/*; do | |
pushd "${file}" | |
zip -r "../qaseprite-${{ github.ref_name }}-$(basename "$file").zip" "." | |
popd | |
done | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: qaseprite ${{ github.ref_name }} | |
files: | | |
qaseprite-${{ github.ref_name }}-source.tar.gz | |
artifacts/*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |