-
Notifications
You must be signed in to change notification settings - Fork 18
100 lines (81 loc) · 3.21 KB
/
build-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
name: Build and Test AppImage
on:
push:
branches:
- wf-test
pull_request:
branches:
- wf-test
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Determine Version
id: version
run: |
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
TAGGED_COMMIT=$(git describe --tags --exact-match 2>/dev/null || echo "notag")
if [ "$TAGGED_COMMIT" = "notag" ]; then
VERSION="${LATEST_TAG}+"
DIST="-git"
else
VERSION=$LATEST_TAG
DIST=""
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "DIST=$DIST" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip
pip3 install appimage-builder
- name: Verify Installation
run: |
which appimage-builder
appimage-builder --version
- name: Build AppImage
run: |
docker run --rm -v $(pwd):/workspace -w /workspace centos:7 /bin/bash -c "
set -eux
# Update repository URLs to use the correct vault since CentOS 7.9.2009 has reached EOL
echo 'Updating repository URLs...'
sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/CentOS-*.repo
sed -i 's|^#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=http://vault.centos.org/7.9.2009/os/x86_64|g' /etc/yum.repos.d/CentOS-*.repo
yum clean all && yum makecache
# Install EPEL repository first
echo 'Installing epel-release...'
yum install -y epel-release
# Install all required packages
echo 'Installing dependencies...'
yum install -y gcc make automake autoconf gtk3-devel \
gettext-devel libtool fuse fuse-libs patchelf wget
# Build the application
echo 'Building the application...'
./autogen.sh && ./configure && make
# Prepare AppDir and copy necessary files
echo 'Preparing AppDir...'
mkdir -p AppDir/usr/bin AppDir/usr/share/icons/hicolor/scalable/apps AppDir/usr/share/applications
# Install the application into AppDir
echo 'Installing the application...'
make install DESTDIR=$(pwd)/AppDir
# Manually copy files to their destinations within AppDir
cp src/xnec2c AppDir/usr/bin/xnec2c
cp resources/xnec2c.svg AppDir/usr/share/icons/hicolor/scalable/apps/xnec2c.svg
cp files/xnec2c.desktop AppDir/usr/share/applications/xnec2c.desktop
"
- name: Generate AppImage with appimage-builder
run: |
appimage-builder --recipe appimage-builder.yml
- name: Test AppImage
run: |
chmod +x xnec2c-${VERSION}${DIST}.AppImage
./xnec2c-${VERSION}${DIST}.AppImage -h
- name: Upload AppImage
uses: actions/upload-artifact@v2
with:
name: xnec2c-appimage
path: xnec2c-${VERSION}${DIST}.AppImage