forked from LibreSprite/LibreSprite
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (69 loc) · 2.52 KB
/
cmakeLinux.yml
File metadata and controls
72 lines (69 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Linux
on:
push:
branches: [ trunk ]
pull_request:
branches: [ trunk ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'NO_SW_CHANGE') && !contains(github.event.pull_request.body, 'NO_SW_CHANGE') }}
steps:
- uses: actions/checkout@v3
# install dependencies
- name: update
run: sudo apt-get update
- name: boost
run: |
sudo apt-get install g++ libcurl4-gnutls-dev libfreetype6-dev libgif-dev libgtest-dev libjpeg-dev libpixman-1-dev libpng-dev libsdl2-dev libsdl2-image-dev libtinyxml2-dev libwebp-dev libx11-dev libxcursor-dev ninja-build libnode-dev zlib1g-dev libarchive-dev libfuse2
pip install cmake
# build project
- name: git
run: git submodule update --init --recursive
- name: mkdir
run: mkdir build
- name: check for git tag
id: check_tag
run: |
if git describe --exact-match --tags 2>/dev/null; then
echo "has_tag=true" >> $GITHUB_OUTPUT
else
echo "has_tag=false" >> $GITHUB_OUTPUT
fi
- name: Get short commit hash
id: commit
run: |
SHORT_HASH=$(git rev-parse --short HEAD)
echo "short_hash=$SHORT_HASH" >> $GITHUB_OUTPUT
- name: Update config.h with commit hash
run: |
sed -i 's/"local build"/"${{ steps.commit.outputs.short_hash }}"/g' src/config.h
- name: cmake
run: |
cd build
if [ "${{ steps.check_tag.outputs.has_tag }}" = "true" ]; then
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DRELEASE_TAG=ON ..
else
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
fi
ninja besprited
- name: appimage
run: |
cd build/bin
export ARCH="$(uname -m)"
sh ../../package_linux.sh
mv ./Besprited-anylinux-$ARCH.AppImage ../../
- name: Archive production artifacts
if: runner.arch == 'X64'
uses: actions/upload-artifact@v4
with:
name: besprited-development-linux-x86_64
path: Besprited-anylinux-x86_64.AppImage
if-no-files-found: error