Skip to content

Commit 49e9e1f

Browse files
authored
Update Build.yml
1 parent 83a5359 commit 49e9e1f

File tree

1 file changed

+79
-71
lines changed

1 file changed

+79
-71
lines changed

.github/workflows/Build.yml

+79-71
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# Workflow configuration
33
#--------------------------------------------------------------------------------
44

5-
name: Build
5+
name: Deploy
66
on:
77
push: # Run on push
88
paths-ignore: # File patterns to ignore
99
- '**.md' # Ignore changes to *.md files
10-
10+
1111
pull_request: # Run on pull-request
1212
paths-ignore: # File-patterns to ignore
1313
- '**.md' # Ignore changes to *.md files
@@ -18,85 +18,93 @@ on:
1818

1919
env:
2020
VERSION: "1.4.0"
21-
EXECUTABLE: "hidpi-fixer"
21+
EXECUTABLE: "HiDPI-Fixer"
2222
APPLICATION: "HiDPI-Fixer"
23+
UNIXNAME: "hdpi-fixer"
2324
QMAKE_PROJECT: "HiDPI-Fixer.pro"
25+
PUBLISHER: "Alex Spataru"
26+
QT_VERSION: 5.15.2
27+
QMAKE: qmake
28+
CORES: 12
2429

2530
#--------------------------------------------------------------------------------
26-
# Workflow jobs (GNU/Linux only)
31+
# Workflow jobs
2732
#--------------------------------------------------------------------------------
2833

2934
jobs:
30-
#
31-
# GNU/Linux build (we run on Ubuntu 16.04 to generate AppImage)
32-
#
3335
build-linux:
34-
runs-on: ubuntu-16.04
36+
runs-on: ubuntu-20.04
37+
name: '🐧 Ubuntu 20.04'
3538
steps:
36-
#
37-
# Checkout the repository
38-
#
39-
- name: Checkout repository
40-
uses: actions/checkout@v2
41-
42-
#
43-
# Cache Qt
44-
#
45-
- name: Cache Qt
46-
id: cache-qt
47-
uses: actions/cache@v1
48-
with:
49-
path: ../Qt
50-
key: ${{runner.os}}-QtCache
39+
- name: '🧰 Checkout'
40+
uses: actions/checkout@v2
41+
42+
- name: '⚙️ Cache Qt'
43+
id: cache-qt
44+
uses: actions/cache@v1
45+
with:
46+
path: ../Qt
47+
key: ${{runner.os}}-qt${{env.QT_VERSION}}
48+
49+
- name: '⚙️ Install Qt'
50+
uses: jurplel/install-qt-action@v2
51+
with:
52+
version: ${{env.QT_VERSION}}
53+
#modules: ${{env.QT_MODULES}}
54+
aqtversion: '==2.0.0'
55+
cached: ${{steps.cache-qt.outputs.cache-hit}}
56+
57+
# Install additional dependencies, stolen from:
58+
# https://github.com/mapeditor/tiled/blob/master/.github/workflows/packages.yml
59+
# TODO if I am not too lazy, remove uneeded dependencies
60+
- name: '⚙️ Install dependencies'
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev libxcb-image0-dev libxcb-util0-dev libxcb-cursor-dev libssl-dev libusb-dev libhidapi-dev libhidapi-libusb0 libhidapi-hidraw0
64+
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
5165
52-
#
53-
# Install Qt
54-
#
55-
- name: Install Qt
56-
uses: jurplel/install-qt-action@v2
57-
with:
58-
modules: qtcharts
59-
mirror: http://mirrors.ocf.berkeley.edu/qt/
60-
cached: ${{steps.cache-qt.outputs.cache-hit}}
66+
- name: '🚧 Compile application'
67+
run: |
68+
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
69+
make -j${{env.CORES}}
70+
71+
- name: '⚙️ Install linuxdeploy'
72+
run: |
73+
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
74+
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
75+
chmod +x linuxdeploy-x86_64.AppImage
76+
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
77+
78+
- name: '📦 Create AppImage'
79+
run: |
80+
export QMAKE=/home/runner/work/${{env.EXECUTABLE}}/Qt/${{env.QT_VERSION}}/gcc_64/bin/qmake
81+
export PATH=/home/runner/work/${{env.EXECUTABLE}}/Qt/${{env.QT_VERSION}}/gcc_64/libexec:$PATH
82+
./linuxdeploy-x86_64.AppImage --appdir AppDir -e ${{env.UNIXNAME}} -i deploy/linux/${{env.UNIXNAME}}.png -d deploy/linux/${{env.UNIXNAME}}.desktop --plugin qt --output appimage
83+
rm linuxdeploy-x86_64.AppImage
84+
rm linuxdeploy-plugin-qt-x86_64.AppImage
85+
mv *.AppImage ${{env.EXECUTABLE}}-${{env.VERSION}}.AppImage
6186
62-
#
63-
# Install additional dependencies, stolen from:
64-
# https://github.com/mapeditor/tiled/blob/master/.github/workflows/packages.yml
65-
#
66-
- name: Install dependencies
67-
run: |
68-
sudo apt-get update
69-
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev
87+
- name: '📤 Upload artifact: AppImage'
88+
uses: actions/upload-artifact@v2
89+
with:
90+
name: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
91+
path: ${{env.EXECUTABLE}}-${{env.VERSION}}-Linux.AppImage
7092

71-
#
72-
# Compile the application
73-
#
74-
- name: Compile
93+
# Upload continuous build
94+
upload:
95+
name: '🗂 Create release and upload artifacts'
96+
needs:
97+
- build-linux
98+
runs-on: ubuntu-20.04
99+
steps:
100+
- name: '📥 Download artifacts'
101+
uses: actions/download-artifact@v2
102+
- name: '🗂 Inspect directory after downloading artifacts'
103+
run: ls -alFR
104+
- name: '🚀 Create release and upload artifacts'
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75107
run: |
76-
qmake ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
77-
make -j8
78-
79-
#
80-
# Create the AppImage
81-
#
82-
- name: Create AppImage
83-
run: |
84-
make INSTALL_ROOT=appdir install
85-
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
86-
chmod a+x linuxdeployqt
87-
./linuxdeployqt appdir/usr/share/applications/*.desktop -appimage -bundle-non-qt-libs -extra-plugins=imageformats/libqsvg.so
88-
89-
#
90-
# Rename AppImage to match a consistent format
91-
#
92-
- name: Rename AppImage
93-
run: mv *.AppImage ${{env.APPLICATION}}_${{env.VERSION}}.AppImage
94-
95-
#
96-
# Upload AppImage to build artifacts
97-
#
98-
- name: Upload AppImage
99-
uses: actions/upload-artifact@v2
100-
with:
101-
name: ${{env.APPLICATION}}_${{env.VERSION}}.AppImage
102-
path: ${{env.APPLICATION}}_${{env.VERSION}}.AppImage
108+
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
109+
chmod +x pyuploadtool-x86_64.AppImage
110+
./pyuploadtool-x86_64.AppImage **/${{env.EXECUTABLE}}-${{env.VERSION}}.AppImage

0 commit comments

Comments
 (0)