Skip to content

Commit dedf863

Browse files
committed
Update release actions
1 parent 1f56435 commit dedf863

File tree

1 file changed

+36
-45
lines changed

1 file changed

+36
-45
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Release
33
on:
44
workflow_dispatch:
55

6+
env:
7+
postgis: 3
8+
vroom: 1.12.0
69

710
jobs:
811
release:
@@ -14,37 +17,24 @@ jobs:
1417

1518
steps:
1619
- name: Checkout repository
17-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
1821
with:
1922
fetch-depth: 0
2023

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+
2129
- name: Get postgres version
2230
run: |
2331
sudo service postgresql start
24-
PGVER=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d \()')
32+
PGVER=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
2533
PROJECT_VERSION=$(grep -Po '(?<=project\(VRPROUTING VERSION )[^;]+' CMakeLists.txt)
2634
echo "PGVER=${PGVER}" >> $GITHUB_ENV
2735
echo "PGPORT=5432" >> $GITHUB_ENV
28-
echo "PGIS=3" >> $GITHUB_ENV
2936
echo "PROJECT_VERSION=${PROJECT_VERSION}" >> $GITHUB_ENV
30-
echo "VROOMVER=1.12.0" >> $GITHUB_ENV
31-
32-
- name: Verify Tag Name
33-
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
37+
echo "TAG_NAME=v${PROJECT_VERSION}" >> $GITHUB_ENV
4838
4939
- name: Add PostgreSQL APT repository
5040
run: |
@@ -54,7 +44,7 @@ jobs:
5444
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
5545
5646
- name: Install python
57-
uses: actions/setup-python@v2
47+
uses: actions/setup-python@v5
5848
with:
5949
python-version: '3.x'
6050

@@ -63,8 +53,8 @@ jobs:
6353
sudo apt-get update
6454
sudo apt-get install -y \
6555
postgresql-${PGVER} \
66-
postgresql-${PGVER}-postgis-${PGIS} \
67-
postgresql-${PGVER}-postgis-${PGIS}-scripts \
56+
postgresql-${PGVER}-postgis-${{ env.postgis }} \
57+
postgresql-${PGVER}-postgis-${{ env.postgis }}-scripts \
6858
postgresql-server-dev-${PGVER} \
6959
graphviz \
7060
doxygen
@@ -76,35 +66,41 @@ jobs:
7666
run: |
7767
sudo apt-get install libssl-dev libasio-dev libglpk-dev
7868
69+
- name: Install Google OR-Tools dependencies
70+
run: |
71+
sudo pip install --root=/ ortools
72+
7973
- name: Cache VROOM
8074
id: cache-vroom
81-
uses: actions/cache@v2
75+
uses: actions/cache@v4
8276
env:
8377
cache-name: vroom
8478
with:
85-
path: |
86-
~/vroom-${{ env.VROOMVER }}
87-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.VROOMVER }}
79+
path: vroom-${{ env.vroom }}
80+
key: ${{ matrix.os }}-${{ env.cache-name }}-${{ env.vroom }}
81+
82+
- name: Checkout VROOM
83+
if: steps.cache-vroom.outputs.cache-hit != 'true'
84+
uses: actions/checkout@v4
85+
with:
86+
path: vroom-${{ env.vroom }}
87+
repository: VROOM-Project/vroom
88+
ref: "v${{ env.vroom }}"
89+
submodules: true
8890

8991
- name: Build VROOM
9092
if: steps.cache-vroom.outputs.cache-hit != 'true'
9193
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
94+
cd vroom-${{ env.vroom }}/src
10095
USE_ROUTING=false make shared
10196
10297
- name: Configure
10398
run: |
10499
export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
100+
VROOM=$(pwd)/vroom-${{ env.vroom }}
105101
mkdir build
106102
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 }} ..
103+
cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM} ..
108104
109105
- name: Build
110106
run: |
@@ -114,11 +110,6 @@ jobs:
114110
sudo make install
115111
make doxy
116112
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-
122113
- name: Update Users Documentation
123114
run: |
124115
git checkout origin/gh-pages
@@ -149,10 +140,10 @@ jobs:
149140
tar -zcvf doc-v${PROJECT_VERSION}-en.tar.gz doc-v${PROJECT_VERSION}-en
150141
151142
cd ../..
152-
grep -Pzo "(?s)v${PROJECT_VERSION//./\\.} Release Notes.*?(?=v.\..\.. Release Notes)" NEWS | tr '\0' '\n' > release_body.txt
143+
grep -Pzo "(?s)### vrpRouting ${PROJECT_VERSION//./\\.} Release Notes.*?(?=## vrpRouting)" NEWS.md | tr '\0' '\n' > release_body.txt
153144
154145
# Only executed during the first release
155-
grep -q '[^[:space:]]' < release_body.txt || cp NEWS release_body.txt
146+
grep -q '[^[:space:]]' < release_body.txt || cp NEWS.md release_body.txt
156147
157148
echo >> release_body.txt
158149
echo "**Attachments**" >> release_body.txt
@@ -167,7 +158,7 @@ jobs:
167158
uses: softprops/action-gh-release@v1
168159
with:
169160
body_path: release_body.txt
170-
name: ${{ env.TAG_NAME }}
161+
tag_name: ${{ env.TAG_NAME }}
171162
draft: true
172163
prerelease: false
173164
files: |

0 commit comments

Comments
 (0)