forked from CelestiaProject/CelestiaContent
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 3.11 KB
/
mybuild.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: mybuild
on:
# Triggers the workflow on push or pull request events but only for the master branch
#push:
# branches: [ master ]
#pull_request:
# branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: ["opensuse/tumbleweed"]
repo: ["openSUSE_Tumbleweed"]
# include:
# - os: "opensuse/leap:15.3"
# - repo: "openSUSE_Leap_15.3"
container:
image: ${{ matrix.os }}
# Disable seccomp until a container manager in GitHub recognizes
# clone3() syscall,
# <https://github.com/actions/virtual-environments/issues/3812>.
options: --security-opt seccomp=unconfined
steps:
- name: prep
run: |
zypper -n ar https://download.opensuse.org/repositories/home:munix9/${{ matrix.repo }}/home:munix9.repo
zypper -n ar https://download.opensuse.org/repositories/home:munix9:unstable/${{ matrix.repo }}/home:munix9:unstable.repo
zypper -n --gpg-auto-import-keys ref && zypper -n up
zypper -n in ImageMagick avif-tools 'celestia-tools>= 1.7.0~' cmake git
- name: checkout
uses: actions/checkout@v2
with:
submodules: true
- name: build & install
run: |
mkdir -p build install/org
pushd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON ..
make -O VERBOSE=1 -j && {
echo -e "\n### make install ###\n"
make install DESTDIR=../install/org
}
popd
- name: convert
run: |
for type in avif dds
do
echo -e "\nconvert to '$type' ...\n"
cp -a install/org install/$type
pushd install/$type/usr/share/celestia
cmodfix -a extras-standard/iss/models/iss.cmod extras-standard/iss/models/a_iss.cmod
sed -e 's/\.\(jpg\|png\)/.${type}/g' -i data/*.ssc extras-standard/iss/models/a_iss.cmod \
extras-standard/interstellar-objects/interstellar-objects.ssc
cmodfix -b extras-standard/iss/models/a_iss.cmod extras-standard/iss/models/b_iss.cmod
rm -v extras-standard/iss/models/iss.cmod extras-standard/iss/models/a_iss.cmod
mv -v extras-standard/iss/models/b_iss.cmod extras-standard/iss/models/iss.cmod
for dir in extras-standard textures
do
for img in $(find "$dir" -type f -name "*.jpg" -o -name "*.png")
do
new="${img%.*}.${type}"
test "$type" = "avif" && avifenc -j all "$img" "$new"
test "$type" = "dds" && convert -verbose "$img" -define dds:compression=dxt1 "$new"
rm -v -- "$img"
done
done
popd
done
# - name: upload package_source
# uses: actions/upload-artifact@v2
# if: ${{ success() }}
# with:
# name: package_source
# path: ${{ github.workspace }}/build/android-tools-*.tar.xz