@@ -3,6 +3,9 @@ name: Release
3
3
on :
4
4
workflow_dispatch :
5
5
6
+ env :
7
+ postgis : 3
8
+ vroom : 1.12.0
6
9
7
10
jobs :
8
11
release :
@@ -14,37 +17,30 @@ jobs:
14
17
15
18
steps :
16
19
- name : Checkout repository
17
- uses : actions/checkout@v3
20
+ uses : actions/checkout@v4
18
21
with :
19
22
fetch-depth : 0
20
23
24
+ - name : Initialize mandatory git config
25
+ run : |
26
+ git config user.name "github-actions[bot]"
27
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
28
+
21
29
- name : Get postgres version
22
30
run : |
23
31
sudo service postgresql start
24
- PGVER=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d \()')
32
+ PGVER=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
25
33
PROJECT_VERSION=$(grep -Po '(?<=project\(VRPROUTING VERSION )[^;]+' CMakeLists.txt)
26
34
echo "PGVER=${PGVER}" >> $GITHUB_ENV
27
35
echo "PGPORT=5432" >> $GITHUB_ENV
28
- echo "PGIS=3" >> $GITHUB_ENV
29
36
echo "PROJECT_VERSION=${PROJECT_VERSION}" >> $GITHUB_ENV
30
- echo "VROOMVER=1.12.0" >> $GITHUB_ENV
31
37
32
- - name : Verify Tag Name
38
+ - name : Create and Push Tag
33
39
run : |
34
- TAG_NAME=${GITHUB_REF#refs/*/}
35
- echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
36
- echo ${TAG_NAME}
37
- echo ${PROJECT_VERSION}
38
- if [ "${TAG_NAME}" != "v${PROJECT_VERSION}" ]; then
39
- echo "Tag name should be v${PROJECT_VERSION}"
40
- exit 1
41
- fi
42
-
43
- - name : Extract branch name
44
- run : |
45
- raw=$(git branch -r --contains ${{ github.ref }})
46
- branch=${raw##*/}
47
- echo "BRANCH=$branch" >> $GITHUB_ENV
40
+ git tag -a "v${PROJECT_VERSION}" -m "Release version ${PROJECT_VERSION}"
41
+ git push origin "v${PROJECT_VERSION}"
42
+ env :
43
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
44
49
45
- name : Add PostgreSQL APT repository
50
46
run : |
54
50
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
55
51
56
52
- name : Install python
57
- uses : actions/setup-python@v2
53
+ uses : actions/setup-python@v5
58
54
with :
59
55
python-version : ' 3.x'
60
56
63
59
sudo apt-get update
64
60
sudo apt-get install -y \
65
61
postgresql-${PGVER} \
66
- postgresql-${PGVER}-postgis-${PGIS } \
67
- postgresql-${PGVER}-postgis-${PGIS }-scripts \
62
+ postgresql-${PGVER}-postgis-${{ env.postgis } } \
63
+ postgresql-${PGVER}-postgis-${{ env.postgis } }-scripts \
68
64
postgresql-server-dev-${PGVER} \
69
65
graphviz \
70
66
doxygen
@@ -76,35 +72,41 @@ jobs:
76
72
run : |
77
73
sudo apt-get install libssl-dev libasio-dev libglpk-dev
78
74
75
+ - name : Install Google OR-Tools dependencies
76
+ run : |
77
+ sudo pip install --root=/ ortools
78
+
79
79
- name : Cache VROOM
80
80
id : cache-vroom
81
- uses : actions/cache@v2
81
+ uses : actions/cache@v4
82
82
env :
83
83
cache-name : vroom
84
84
with :
85
- path : |
86
- ~/vroom-${{ env.VROOMVER }}
87
- key : ${{ runner.os }}-${{ env.cache-name }}-${{ env.VROOMVER }}
85
+ path : vroom-${{ env.vroom }}
86
+ key : ${{ matrix.os }}-${{ env.cache-name }}-${{ env.vroom }}
87
+
88
+ - name : Checkout VROOM
89
+ if : steps.cache-vroom.outputs.cache-hit != 'true'
90
+ uses : actions/checkout@v4
91
+ with :
92
+ path : vroom-${{ env.vroom }}
93
+ repository : VROOM-Project/vroom
94
+ ref : " v${{ env.vroom }}"
95
+ submodules : true
88
96
89
97
- name : Build VROOM
90
98
if : steps.cache-vroom.outputs.cache-hit != 'true'
91
99
run : |
92
- git clone --depth 1 --branch v${{ env.VROOMVER }} https://github.com/VROOM-Project/vroom ~/vroom-${{ env.VROOMVER }}
93
-
94
- # init the required submodules
95
- cd ~/vroom-${{ env.VROOMVER }}/
96
- git submodule update --init
97
-
98
- # Using "shared" target for creating Position Independent Code, disabling use of routing
99
- cd ~/vroom-${{ env.VROOMVER }}/src
100
+ cd vroom-${{ env.vroom }}/src
100
101
USE_ROUTING=false make shared
101
102
102
103
- name : Configure
103
104
run : |
104
105
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
106
+ VROOM=$(pwd)/vroom-${{ env.vroom }}
105
107
mkdir build
106
108
cd build
107
- cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=$HOME/vroom-${{ env.VROOMVER } } ..
109
+ cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM } ..
108
110
109
111
- name : Build
110
112
run : |
@@ -114,11 +116,6 @@ jobs:
114
116
sudo make install
115
117
make doxy
116
118
117
- - name : Initialize mandatory git config
118
- run : |
119
- git config user.name "github-actions[bot]"
120
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
121
-
122
119
- name : Update Users Documentation
123
120
run : |
124
121
git checkout origin/gh-pages
@@ -149,10 +146,10 @@ jobs:
149
146
tar -zcvf doc-v${PROJECT_VERSION}-en.tar.gz doc-v${PROJECT_VERSION}-en
150
147
151
148
cd ../..
152
- grep -Pzo "(?s)v${PROJECT_VERSION//./\\.} Release Notes.*?(?=v.\..\.. Release Notes)" NEWS | tr '\0' '\n' > release_body.txt
149
+ grep -Pzo "(?s)v${PROJECT_VERSION//./\\.} Release Notes.*?(?=v.\..\.. Release Notes)" NEWS.md | tr '\0' '\n' > release_body.txt
153
150
154
151
# Only executed during the first release
155
- grep -q '[^[:space:]]' < release_body.txt || cp NEWS release_body.txt
152
+ grep -q '[^[:space:]]' < release_body.txt || cp NEWS.md release_body.txt
156
153
157
154
echo >> release_body.txt
158
155
echo "**Attachments**" >> release_body.txt
0 commit comments