-
-
Notifications
You must be signed in to change notification settings - Fork 0
275 lines (272 loc) · 14.7 KB
/
appimage.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#name: appimage
on:
# Triggers the workflow on push or pull request events but only for the main branch
#push:
# branches: [ main ]
#pull_request:
# branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
ppa:
description: "ppa sufix"
artifact:
description: "result is artifact"
unpublished:
description: "don't wait to publish, take from build page"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
#this is also required at unpublished from now, not only at tests
# if: ${{ env.init != '' }}
#
#with:
# repository: colin-i/irc
# path: my-tools
#- uses: dsaltares/fetch-gh-release-asset@master
#this is locally: throw new Error("Parameter token or opts.auth is required");
# with:
# repo: 'colin-i/test'
# file: 'ovideo.png'
# target: 'in/' #plague-linux.zip'
# #version: 'tags/1.5'
# #token: ${{ secrets.PAT }}
#Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
if [ -n "${{ env.init }}" ]; then
exit
fi
mkdir -p AppDir
file=runtime
arch_ai=-x86_64
archfile=${file}${arch_ai}
kitpart () {
#this is not working anymore urlpart=`wget -q https://github.com/AppImage/AppImageKit/releases/latest -O - | grep "${archfile}" | head -n 1 | cut -d '"' -f 2`
urlpart=AppImage/AppImageKit/releases/latest/download/${archfile}
}
if [ ! -e "${file}" ]; then
kitpart
#"pkg2appimage-.*-x86_64.AppImage"
wget -c https://github.com/${urlpart}
mv ${archfile} ${file}
chmod a+x ${file}
fi
downdebok () {
src=${1}
arch=${2}
nr=${3}
pkg=${4}
inter=Packages${arch}${nr}
if [ ! -e "${inter}" ]; then
rep=${5}
wget http://${src}/ubuntu/dists/${6}/${rep}/binary-${arch}/Packages.xz -O ${inter}.xz
xz -d ${inter}.xz #f for multiple times
fi
#pipe to true to not stop the workflow if grep exits!=0
debfilename=`grep "^Filename.*/${pkg}_" ${inter}` # || true is ok now but if package is not, without this, will be workflow fail
#if [ -z "${debfilename}" ]; then
# next time with if arch = i386 :i386 and reform array and try on
# not_are+=" ${pkg}"
# return
#fi
debfilename=`echo ${debfilename} | tail -1 | cut -d ' ' -f 2`
wget_url=http://${src}/ubuntu/${debfilename}
#https://launchpad.net/~colin-i/+archive/ubuntu/ppa/+files/${debfilename} | grep -o '[^/]*$'
maindeb=${pkg}.deb
wget ${wget_url} -O ${maindeb}
dpkg -x ${maindeb} AppDir
#ar x ${maindeb} data.tar.xz
#xz -fd data.tar.xz
#tar -xf data.tar -C AppDir
}
downdeb () {
if [ ! -e "${4}.deb" ]; then
downdebok ${1} ${2} ${3} ${4} ${5} focal
fi
}
if [ ! -e "ovideo.deb" ]; then
if [ "${{ github.event.inputs.unpublished }}" = "" ]; then
echo published
downdebok "ppa.launchpadcontent.net/colin-i/ppa${{ github.event.inputs.ppa }}" i386 1 ovideo main bionic
else
echo unpublished
#
if [ ! -e "lp2.py" ]; then
wget -q https://raw.githubusercontent.com/colin-i/test/master/lp2.py
#
#is already at focal
sudo apt install python3-launchpadlib
fi
name=`cat debian/changelog | head -1 | grep -o ^[^\ ]*`
version=`cat debian/changelog | head -1 | grep -Poe "[^\(]*(?=\))"`
arh=i386
OUTPUT=$(python3 lp2.py ppa${{ github.event.inputs.ppa }} ${name} ${version} ${arh})
wget ${OUTPUT}/+files/${name}_${version}_${arh}.deb -O ${name}.deb
#
#f=`wget -q https://launchpad.net/~colin-i/+archive/ubuntu/ppa${{ github.event.inputs.ppa }}/+build/${{ github.event.inputs.unpublished }} -O - | grep -o -e "[^\"]*\.deb\""`
#wget ${f:0:-1} -O ovideo.deb
dpkg -x ${name}.deb AppDir
fi
fi
#get the list with apt install --download-only and -o ... like in test/update/up , and then Get:1 ... jammy/main , ... , Get:2 ... jammy/universe
array=( \
gcc-10-base:i386 glib-networking:i386 gstreamer1.0-plugins-base:i386 gstreamer1.0-plugins-good:i386 gstreamer1.0-x:i386 libaa1:i386 libasn1-8-heimdal:i386 libasound2:i386 libasyncns0:i386 libatk1.0-0:i386 libatomic1:i386 libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libavc1394-0:i386 libblkid1:i386 libbrotli1:i386 libbsd0:i386 libbz2-1.0:i386 libc6:i386 libcaca0:i386 libcairo-gobject2:i386 libcairo2:i386 libcap2:i386 libcdparanoia0:i386 libcom-err2:i386 libcrypt1:i386 libcups2:i386 libcurl3-gnutls:i386 libdatrie1:i386 libdb5.3:i386 libdbus-1-3:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libdv4:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libffi7:i386 libfftw3-double3:i386 libflac8:i386 libfontconfig1:i386 libfreetype6:i386 libfribidi0:i386 libgail-common:i386 libgail18:i386 libgcc-s1:i386 libgcrypt20:i386 libgdk-pixbuf2.0-0:i386 libglib2.0-0:i386 libgmp10:i386 libgnutls30:i386 libgomp1:i386 libgpg-error-l10n libgpg-error0:i386 libgpm2:i386 libgraphite2-3:i386 libgssapi-krb5-2:i386 libgssapi3-heimdal:i386 libgssdp-1.2-0:i386 libgstreamer-plugins-base1.0-0:i386 libgstreamer-plugins-good1.0-0:i386 libgstreamer1.0-0:i386 libgtk2.0-0:i386 libgudev-1.0-0:i386 libgupnp-1.2-0:i386 libharfbuzz0b:i386 libhcrypto4-heimdal:i386 libheimbase1-heimdal:i386 libheimntlm0-heimdal:i386 libhogweed5:i386 libhx509-5-heimdal:i386 libicu66:i386 libidn2-0:i386 libiec61883-0:i386 libjack-jackd2-0:i386 libjbig0:i386 libjpeg-turbo8:i386 libjpeg8:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-26-heimdal:i386 libkrb5-3:i386 libkrb5support0:i386 liblcms2-2:i386 libldap-2.4-2:i386 libllvm9:i386 liblz4-1:i386 liblzma5:i386 libmount1:i386 libmp3lame0:i386 libmpg123-0:i386 libncurses6:i386 libncursesw6:i386 libnettle7:i386 libnghttp2-14:i386 libnuma1:i386 libogg0:i386 libopenjp2-7:i386 libopus0:i386 liborc-0.4-0:i386 libp11-kit0:i386 libpango-1.0-0:i386 libpangocairo-1.0-0:i386 libpangoft2-1.0-0:i386 libpciaccess0:i386 libpcre2-8-0:i386 libpcre3:i386 libpixman-1-0:i386 libpng16-16:i386 libproxy1v5:i386 libpsl5:i386 libpulse0:i386 libraw1394-11:i386 libreadline8:i386 libroken18-heimdal:i386 librsvg2-2:i386 librsvg2-common:i386 librtmp1:i386 libsamplerate0:i386 libsasl2-2:i386 libsasl2-modules:i386 libsasl2-modules-db:i386 libsbc1:i386 libselinux1:i386 libshout3:i386 libslang2:i386 libsnappy1v5:i386 libsndfile1:i386 libsoup2.4-1:i386 libsoxr0:i386 libspeex1:i386 libsqlite3-0:i386 libssh-4:i386 libssl1.1:i386 libstdc++6:i386 libsystemd0:i386 libtag1v5:i386 libtag1v5-vanilla:i386 libtasn1-6:i386 libthai0:i386 libtheora0:i386 libtiff5:i386 libtinfo6:i386 libtwolame0:i386 libudev1:i386 libunistring2:i386 libusb-1.0-0:i386 libuuid1:i386 libv4l-0:i386 libv4lconvert0:i386 libvdpau1:i386 libvisual-0.4-0:i386 libvorbis0a:i386 libvorbisenc2:i386 libvorbisfile3:i386 libvpx6:i386 libvulkan1:i386 libwavpack1:i386 libwayland-client0:i386 libwayland-cursor0:i386 libwayland-egl1:i386 libwebp6:i386 libwebpmux3:i386 libwebrtc-audio-processing1:i386 libwind0-heimdal:i386 libwrap0:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-present0:i386 libxcb-randr0:i386 libxcb-render0:i386 libxcb-shm0:i386 libxcb-sync1:i386 libxcb-xfixes0:i386 libxcb1:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxkbcommon0:i386 libxml2:i386 libxrandr2:i386 libxrender1:i386 libxshmfence1:i386 libxss1:i386 libxv1:i386 libxxf86vm1:i386 libzstd1:i386 mesa-vdpau-drivers:i386 mesa-vulkan-drivers:i386 ocl-icd-libopencl1:i386 vdpau-driver-all:i386 zlib1g:i386 \
)
for var in "${array[@]}"
do
#base for playback, good for pixbuf - these , at runtime, warns many main/universe missings
if [ -n "$(echo -n ${var} | grep -o : )" ]; then
#var=`echo $var | tr 'Q' '\n' | xargs echo `
var=`echo -n ${var} | grep -o -e "^[^:]*"`
downdeb "ro.archive.ubuntu.com" i386 2 ${var} main
else
downdeb "ro.archive.ubuntu.com" amd64 1 ${var} main
fi
done
array=( \
gstreamer1.0-plugins-bad:i386 i965-va-driver:i386 intel-media-va-driver:i386 libaom0:i386 libass9:i386 libavcodec58:i386 libavutil56:i386 libbs2b0:i386 libchromaprint1:i386 libcodec2-0.9:i386 libdc1394-22:i386 libdca0:i386 libde265-0:i386 libdvdnav4:i386 libdvdread7:i386 libfaad2:i386 libflite1:i386 libfluidsynth2:i386 libgme0:i386 libgsm1:i386 libgstreamer-plugins-bad1.0-0:i386 libgupnp-igd-1.0-4:i386 libigdgmm11:i386 libilmbase24:i386 libinstpatch-1.0-2:i386 libkate1:i386 liblilv-0-0:i386 libmjpegutils-2.1-0:i386 libmms0:i386 libmodplug1:i386 libmpcdec6:i386 libmpeg2encpp-2.1-0:i386 libmplex2-2.1-0:i386 libnice10:i386 libofa0:i386 libopenal-data libopenal1:i386 libopenexr24:i386 libopenmpt0:i386 libsdl2-2.0-0:i386 libserd-0-0:i386 libshine3:i386 libsndio7.0:i386 libsord-0-0:i386 libsoundtouch1:i386 libspandsp2:i386 libsratom-0-0:i386 libsrt1:i386 libsrtp2-1:i386 libswresample3:i386 libusrsctp1:i386 libva-drm2:i386 libva-x11-2:i386 libva2:i386 libvo-aacenc0:i386 libvo-amrwbenc0:i386 libwildmidi2:i386 libx264-155:i386 libx265-179:i386 libxvidcore4:i386 libzbar0:i386 libzvbi-common libzvbi0:i386 mesa-va-drivers:i386 timgm6mb-soundfont va-driver-all:i386 \
)
for var in "${array[@]}"
do
#bad for mxf
if [ -n "$(echo -n ${var} | grep -o : )" ]; then
var=`echo -n ${var} | grep -o -e "^[^:]*"`
downdeb "ro.archive.ubuntu.com" i386 3 ${var} universe
else
downdeb "ro.archive.ubuntu.com" amd64 2 ${var} universe
fi
done
#echo ${not_are}
#exit
cd AppDir
file2=AppRun
if [ ! -e "${file2}" ]; then
if [ -z "${urlpart}" ]; then
kitpart
fi
archfile2=${file2}${arch_ai}
urlpart=${urlpart:0:`echo ${urlpart} | grep -ob '[^/]*$' | cut -d ':' -f 1`}${archfile2}
wget -c https://github.com/${urlpart}
chmod a+x ${archfile2}
mv ${archfile2} ${file2}
fi
pngfile=ovideo.png
if [ ! -e "${pngfile}" ]; then
wget https://github.com/colin-i/test/releases/download/1.5/ovideo.png -O ${pngfile} #O for multiple times
cat > ovideo.desktop <<EOF
[Desktop Entry]
Type=Application
Name=OVideo
Exec=ovideo
Icon=ovideo
Categories=AudioVideo
EOF
ln -s ${pngfile} .DirIcon #f for multiple times
fi
#
cd usr/lib
if [ ! -e "gstreamer-1.0" ]; then
echo ln
#this is not ok: only when running the appimage file: when testing with GST_DEBUG=5: GST_PLUGIN_SYSTEM_PATH will miss /i386-linux-gnu
ln -s i386-linux-gnu/gstreamer-1.0 gstreamer-1.0
#this also at runtime, missing
ln -s i386-linux-gnu/pulseaudio/libpulsecommon-13.99.so libpulsecommon-13.99.so
fi
cd ../../
#
if [ ! -e "usr/bin/ostream" ]; then
echo launcher
gpixd=/usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/
gpixf=${gpixd}`ls -1 .${gpixd} | head -1`/loaders
cd usr/bin
mv ovideo ostream
#live64 is not having /lib/ld-linux.so.2. without librarypath will wrong libc bionic to jammy
#./lib since zlib1g. ./usr/lib for liblilv-0.so.0
#this is in tmp folder, don't check inside if loaders.cache exists
# --library-path \"${rootbase}... will be with problems
#if there are problems, try this: GTK_MODULE_DIR
#to not see GST_PLUGIN_SCANNER warning, extract, run once, it is writing elsewhere not in appimg folders, run second time and is ok
#if is same with or without GST_PLUGIN_SCANNER then why set? GST_DEBUG=6 will state "Trying GST_PLUGIN_SCANNER env var" so the fault is from there
cat > ovideo <<EOF
#!/bin/bash
cd "\$(dirname "\$0")"
cd ../../
loader="./lib/ld-linux.so.2"
hom=\${HOME}/ovideo
mkdir -p "\${hom}"
gpmf=\${hom}/loaders.cache
rootbase=\$(pwd)
paths="\${rootbase}/lib:\${rootbase}/usr/lib:\${rootbase}/usr/lib/i386-linux-gnu:\${rootbase}/lib/i386-linux-gnu"
LD_LIBRARY_PATH="\${paths}" \
GDK_PIXBUF_MODULEDIR="\${rootbase}${gpixf}" \
\${loader} .${gpixd}gdk-pixbuf-query-loaders > "\${gpmf}"
LD_LIBRARY_PATH="\${paths}" \
GDK_PIXBUF_MODULE_FILE="\${gpmf}" \
GIO_EXTRA_MODULES="\${rootbase}/usr/lib/i386-linux-gnu/gio/modules" \
GST_PLUGIN_SCANNER="\${rootbase}/usr/lib/i386-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" \
GST_PLUGIN_SYSTEM_PATH="\${rootbase}/usr/lib/gstreamer-1.0" \
\${loader} ./usr/bin/ostream "\${rootbase}"
EOF
chmod 755 ovideo
cd ../../
fi
#metadata file
mi=usr/share/metainfo
mif=${mi}/com.colin.ovideo.appdata.xml
if [ ! -e "${mif}" ]; then
mkdir -p ${mi}
cat > ${mif} <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2022 -->
<component type="desktop-application">
<id>com.colin.ovideo</id>
<metadata_license>FSFAP</metadata_license>
<name>O Video</name>
<summary>Video Editor</summary>
<description>
<ul>
<li>Create videos</li>
<li>Add animations</li>
<li>Edit frames</li>
</ul>
</description>
<screenshots>
<screenshot type="default">
<caption>OVideo image</caption>
<image>https://raw.github.com/colin-i/ostream/master/arh/ovideo.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://www.github.com/colin-i/ostream</url>
<content_rating/>
</component>
EOF
fi
#
cd ..
#
if [ ! -e "ovideo.AppImage" ]; then
mksquashfs AppDir ovideo.squashfs -root-owned -noappend
cat runtime >> ovideo.AppImage
cat ovideo.squashfs >> ovideo.AppImage
chmod a+x ovideo.AppImage
fi
#http://ro.archive.ubuntu.com/ubuntu/dists/bionic/main/binary-i386/Packages.xz
#https://stackoverflow.com/questions/9981099/are-exported-private-keys-in-gpg-still-encrypted
#echo -n ${{ secrets.PASS }} > pas.txt
#echo "tag=refs/tags/1.5" >> $GITHUB_ENV
#echo $tag ${{ env.tag }}
#ARCH=i686 ${file} ./ovideo.yml
- name: test artifact
if: ${{ github.event.inputs.artifact != '' }}
uses: actions/upload-artifact@v3
with:
name: appimage
path: ./*.AppImage