abaddon/.github/workflows/ci.yml

232 lines
9.1 KiB
YAML
Raw Normal View History

name: Abaddon CI
on: [ push, pull_request ]
jobs:
2021-11-09 06:13:06 +00:00
msys2:
name: msys2-mingw64
runs-on: windows-latest
strategy:
matrix:
buildtype: [ Debug, RelWithDebInfo, MinSizeRel ]
mindeps: [ false ]
2022-04-21 01:50:57 +00:00
include:
- buildtype: RelWithDebInfo
mindeps: true
2021-11-09 06:13:06 +00:00
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v1
with:
submodules: true
2022-04-21 01:50:57 +00:00
- name: Setup MSYS2 (1)
uses: haya14busa/action-cond@v1
id: setupmsys
2021-11-09 06:13:06 +00:00
with:
2022-04-21 01:50:57 +00:00
cond: ${{ matrix.mindeps == true }}
if_true: >-
git
make
unzip
2022-04-21 01:50:57 +00:00
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-sqlite3
mingw-w64-x86_64-nlohmann-json
mingw-w64-x86_64-curl
mingw-w64-x86_64-zlib
mingw-w64-x86_64-gtkmm3
2022-11-08 02:53:05 +00:00
mingw-w64-x86_64-spdlog
2022-04-21 01:50:57 +00:00
if_false: >-
2021-11-09 06:13:06 +00:00
git
make
unzip
2021-11-09 06:13:06 +00:00
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-sqlite3
mingw-w64-x86_64-nlohmann-json
mingw-w64-x86_64-curl
mingw-w64-x86_64-zlib
mingw-w64-x86_64-gtkmm3
2022-04-17 06:26:21 +00:00
mingw-w64-x86_64-libhandy
2022-08-31 07:01:48 +00:00
mingw-w64-x86_64-opus
mingw-w64-x86_64-libsodium
2022-11-08 02:53:05 +00:00
mingw-w64-x86_64-spdlog
2021-11-09 06:13:06 +00:00
2022-04-21 01:50:57 +00:00
- name: Setup MSYS2 (2)
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: ${{ steps.setupmsys.outputs.value }}
2022-08-31 21:55:03 +00:00
- name: Build (1)
uses: haya14busa/action-cond@v1
2023-02-05 01:20:39 +00:00
id: build
2022-08-31 21:55:03 +00:00
with:
cond: ${{ matrix.mindeps == true }}
if_true: |
2023-07-18 06:02:39 +00:00
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} -DUSE_LIBHANDY=OFF -DENABLE_VOICE=OFF -DENABLE_NOTIFICATION_SOUNDS=OFF -DENABLE_QRCODE_LOGIN=OFF -DENABLE_RNNOISE=OFF
2022-08-31 21:55:03 +00:00
cmake --build build
if_false: |
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} -DCMAKE_CXX_FLAGS="-Wl,--default-image-base-low"
2022-08-31 21:55:03 +00:00
cmake --build build
2023-03-14 17:24:02 +00:00
- name: Build (2)
2023-02-05 01:20:39 +00:00
run: ${{ steps.build.outputs.value }}
2021-11-09 06:13:06 +00:00
2021-11-18 07:02:28 +00:00
- name: Setup Artifact
run: |
2023-02-21 03:43:29 +00:00
artifact_dir=build/artifactdir/abaddon-${{ matrix.buildtype }}-${GITHUB_SHA::7}
mkdir -p ${artifact_dir}/bin ${artifact_dir}/etc/ssl/certs ${artifact_dir}/lib ${artifact_dir}/share/glib-2.0/schemas
2021-11-18 07:37:08 +00:00
cd build
2023-02-21 03:43:29 +00:00
cp *.exe ../${artifact_dir}/bin
2021-11-18 07:22:53 +00:00
cd ..
2023-02-21 03:43:29 +00:00
cp /mingw64/etc/ssl/certs/ca-bundle.crt ${artifact_dir}/etc/ssl/certs
cp -r /mingw64/lib/gdk-pixbuf-2.0 ${artifact_dir}/lib
cp -r res/css res/res res/fonts ${artifact_dir}/bin
cp /mingw64/share/glib-2.0/schemas/gschemas.compiled ${artifact_dir}/share/glib-2.0/schemas
cat "ci/msys-deps.txt" | sed 's/\r$//' | xargs -I % cp /mingw64% ${artifact_dir}/bin || :
cp /usr/bin/msys-ffi-8.dll ${artifact_dir}/bin/libffi-8.dll
mkdir -p ${artifact_dir}/share/icons/Adwaita
cd ${artifact_dir}/share/icons/Adwaita
mkdir -p 16x16/actions 24x24/actions 32x32/actions 48x48/actions 64x64/actions 96x96/actions scalable/actions
2023-05-20 00:31:45 +00:00
mkdir -p 16x16/devices 24x24/devices 32x32/devices 48x48/devices 64x64/devices 96x96/devices scalable/devices
mkdir -p 16x16/status 24x24/status 32x32/status 48x48/status 64x64/status 96x96/status scalable/status
2023-03-15 00:37:22 +00:00
cd ${GITHUB_WORKSPACE}
wget https://github.com/rtlewis1/GTK/archive/refs/heads/Material-Black-Colors-Desktop.zip
unzip Material-Black-Colors-Desktop.zip 'GTK-Material-Black-Colors-Desktop/Material-Black-Cherry/**/*'
mkdir -p ${artifact_dir}/share/themes
mv ./GTK-Material-Black-Colors-Desktop/Material-Black-Cherry ${artifact_dir}/share/themes/Material-Black-Cherry
cp -r ci/tree/. ${artifact_dir}
2023-05-28 22:03:36 +00:00
cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/index.theme ${artifact_dir}/share/icons/Adwaita/index.theme
cat "ci/used-icons.txt" | sed 's/\r$//' | xargs -I % cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/16x16/%.symbolic.png ${artifact_dir}/share/icons/Adwaita/16x16/%.symbolic.png || :
cat "ci/used-icons.txt" | sed 's/\r$//' | xargs -I % cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/24x24/%.symbolic.png ${artifact_dir}/share/icons/Adwaita/24x24/%.symbolic.png || :
cat "ci/used-icons.txt" | sed 's/\r$//' | xargs -I % cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/32x32/%.symbolic.png ${artifact_dir}/share/icons/Adwaita/32x32/%.symbolic.png || :
cat "ci/used-icons.txt" | sed 's/\r$//' | xargs -I % cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/48x48/%.symbolic.png ${artifact_dir}/share/icons/Adwaita/48x48/%.symbolic.png || :
cat "ci/used-icons.txt" | sed 's/\r$//' | xargs -I % cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/64x64/%.symbolic.png ${artifact_dir}/share/icons/Adwaita/64x64/%.symbolic.png || :
cat "ci/used-icons.txt" | sed 's/\r$//' | xargs -I % cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/96x96/%.symbolic.png ${artifact_dir}/share/icons/Adwaita/96x96/%.symbolic.png || :
cat "ci/used-icons.txt" | sed 's/\r$//' | xargs -I % cp ci/gtk-for-windows/gtk-nsis-pack/share/icons/Adwaita/scalable/%.svg ${artifact_dir}/share/icons/Adwaita/scalable/%.svg || :
2023-06-03 20:56:10 +00:00
cd ${artifact_dir}/share/icons/Adwaita
gtk-update-icon-cache .
2022-04-21 01:50:57 +00:00
- name: Upload build (1)
uses: haya14busa/action-cond@v1
id: buildname
with:
cond: ${{ matrix.mindeps == true }}
if_true: "${{ matrix.buildtype }}-mindeps"
if_false: "${{ matrix.buildtype }}"
2021-11-18 07:02:28 +00:00
2022-04-21 01:50:57 +00:00
- name: Upload build (2)
2021-11-09 06:13:06 +00:00
uses: actions/upload-artifact@v2
with:
2022-04-21 01:50:57 +00:00
name: build-windows-msys2-${{ steps.buildname.outputs.value }}
2021-11-18 07:02:28 +00:00
path: build/artifactdir
2021-11-09 06:13:06 +00:00
mac:
name: macos-${{ matrix.buildtype }}
runs-on: macos-latest
strategy:
matrix:
buildtype: [ Debug, RelWithDebInfo ]
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Fetch CMake
2021-10-19 03:56:36 +00:00
uses: lukka/get-cmake@v3.21.2
- name: Fetch dependencies
run: |
2023-02-20 21:18:29 +00:00
brew install pkg-config
brew install gtkmm3
brew install nlohmann-json
2022-08-14 04:02:19 +00:00
brew install jpeg
2022-08-31 07:01:48 +00:00
brew install opus
brew install libsodium
2022-11-08 02:53:05 +00:00
brew install spdlog
brew install libhandy
- name: Build
2021-10-19 03:56:36 +00:00
uses: lukka/run-cmake@v3
with:
buildDirectory: ${{ runner.workspace }}/build
cmakeBuildType: ${{ matrix.buildtype }}
- name: Setup artifact files
run: |
2023-02-21 03:43:29 +00:00
artifact_dir=build/artifactdir/abaddon-${{ matrix.buildtype }}-${GITHUB_SHA::7}
mkdir -p "${artifact_dir}"
cp "${{runner.workspace}}/build/abaddon" "${artifact_dir}/abaddon"
cp -r "${{ github.workspace }}/res/css" "${artifact_dir}/css"
cp -r "${{ github.workspace }}/res/res" "${artifact_dir}/res"
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build-macos-${{ matrix.buildtype }}
2023-02-21 03:43:29 +00:00
path: build/artifactdir
linux:
name: linux-${{ matrix.buildtype }}
runs-on: ubuntu-22.04
strategy:
matrix:
buildtype: [ Debug, RelWithDebInfo, MinSizeRel ]
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Fetch CMake
2021-10-19 03:56:36 +00:00
uses: lukka/get-cmake@v3.21.2
- name: Fetch dependencies
run: |
2021-04-03 07:25:06 +00:00
sudo apt-get update
mkdir deps
cd deps
git clone https://github.com/nlohmann/json
cd json
git checkout bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d
mkdir build
cd build
cmake ..
make
sudo make install
sudo apt-get install libgtkmm-3.0-dev
sudo apt-get install libcurl4-gnutls-dev
2022-08-31 07:01:48 +00:00
sudo apt-get install libopus-dev
sudo apt-get install libsodium-dev
2022-11-08 02:53:05 +00:00
sudo apt-get install libspdlog-dev
sudo apt-get install libhandy-1-dev
- name: Build
2021-10-19 03:56:36 +00:00
uses: lukka/run-cmake@v3
env:
CC: gcc-9
CXX: g++-9
with:
cmakeAppendedArgs: -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
buildDirectory: ${{ runner.workspace }}/build
cmakeBuildType: ${{ matrix.buildtype }}
- name: Setup artifact files
run: |
2023-02-21 03:43:29 +00:00
artifact_dir=${{ runner.workspace }}/artifactdir/abaddon-${{ matrix.buildtype }}-${GITHUB_SHA::7}
mkdir -p "${artifact_dir}"
cp "${{runner.workspace}}/build/abaddon" "${artifact_dir}/abaddon"
cp -r "${{ github.workspace }}/res/css" "${artifact_dir}/css"
cp -r "${{ github.workspace }}/res/res" "${artifact_dir}/res"
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build-linux-${{ matrix.buildtype }}
path: ${{ runner.workspace }}/artifactdir