-
Notifications
You must be signed in to change notification settings - Fork 157
117 lines (105 loc) · 4.07 KB
/
ubuntu_build.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
# This is a basic workflow to help you get started with Actions
name: Ubuntu builds
# Controls when the action will run.
on:
# Triggers the workflow on push only for the master branch
push:
branches: [master]
paths-ignore:
- '**/README.md'
pull_request:
branches: [master]
paths-ignore:
- '**/README.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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"
ubuntu_build:
# The type of runner that the job will run on
runs-on: ${{ matrix.distro }}
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
fail-fast: true
matrix:
distro:
- 'ubuntu-24.04'
- 'ubuntu-22.04'
- 'ubuntu-20.04'
include:
- distro: 'ubuntu-24.04'
pre: 'noble'
ldflags: '-lgdal -lcurl -L/usr/lib/x86_64-linux-gnu -lz -lwebkit2gtk-4.1 -lEGL -ljavascriptcoregtk-4.1'
- distro: 'ubuntu-22.04'
pre: 'jammy'
ldflags: '-lgdal -lcurl -L/usr/lib/x86_64-linux-gnu -lz -lwebkit2gtk-4.0 -lEGL -ljavascriptcoregtk-4.0'
- distro: 'ubuntu-20.04'
pre: 'focal'
ldflags: '-lgdal -lcurl -L/usr/lib/x86_64-linux-gnu -lz -lwebkit2gtk-4.0 -lEGL -ljavascriptcoregtk-4.0'
env:
platform: ${{ matrix.distro }}
GEODA_VER: '1.22.0'
TARGET_OS: ${{ matrix.pre }}
EXTRA_GEODA_LD_FLAGS: ${{ matrix.ldflags }}
# 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
- name: Prepare on ${{ matrix.distro }}
run: |
chmod +x BuildTools/ubuntu/create_deps.sh
chmod +x BuildTools/ubuntu/install.sh
echo ${{ env.TARGET_OS }}
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -y
sudo apt-get install -y ca-certificates libgnutls30
echo '-k' > ~/.curlrc
sudo apt-get install -y libpq-dev
sudo apt-get install -y gdal-bin
sudo apt-get install -y libgdal-dev
sudo apt-get install -y unzip cmake dh-autoreconf libgtk-3-dev libgl1-mesa-dev libglu1-mesa-dev
export OS=${{ env.TARGET_OS }}
if [ $OS = 'jammy' ] ; then
sudo apt-get install -y libwebkit2gtk-4.0-dev
elif [ $OS = 'focal' ] ; then
sudo apt-get install -y libwebkit2gtk-4.0-dev
elif [ $OS = 'noble' ] ; then
sudo apt-get install -y libgtk-4-dev libwebkit2gtk-4.1-dev
else
sudo apt-get install -y libwebkitgtk-3.0-dev
fi
- uses: actions/cache@v3
id: cache
with:
path: |
BuildTools/ubuntu/libraries
BuildTools/ubuntu/temp
key: ${{ runner.os }}-${{ env.TARGET_OS }}-deps-cache-${{ hashFiles('BuildTools/ubuntu/create_deps.sh') }}
# Create Deps
- if: steps.cache.outputs.cache-hit != 'true'
name: Create Dependencies
run: |
export WORK_DIR=$PWD
export OS=${{ env.TARGET_OS }}
export VER=${{ env.GEODA_VER }}
export APT="sudo apt-get"
cd BuildTools/ubuntu
./create_deps.sh
# Build GeoDa
- name: Build GeoDa
run: |
mkdir -p o
chmod 755 o
export WORK_DIR=$PWD
export OS=${{ env.TARGET_OS }}
export VER=${{ env.GEODA_VER }}
export EXTRA_GEODA_LD_FLAGS='${{ env.EXTRA_GEODA_LD_FLAGS }}'
export APT="sudo apt-get"
cd BuildTools/ubuntu
./install.sh
# Upload artifact
- uses: actions/upload-artifact@v3
with:
name: GeoDa-${{ env.GEODA_VER }}-${{ env.TARGET_OS }}
path: ${{ github.workspace }}/BuildTools/ubuntu/geoda_${{ env.GEODA_VER }}-1${{ env.TARGET_OS }}1_amd64.deb