From b1a50dc2e240c4869c6ac75b17d939d789c2e178 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Date: Wed, 24 Jul 2024 21:08:37 +0200 Subject: [PATCH] Fix release script --- .github/workflows/release.yml | 47 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2db824d02..db96bec95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,9 @@ name: Release on: workflow_dispatch: +env: + postgis: 3 + vroom: 1.12.0 jobs: release: @@ -14,20 +17,18 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Get postgres version run: | sudo service postgresql start - PGVER=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d \()') + pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()') PROJECT_VERSION=$(grep -Po '(?<=project\(VRPROUTING VERSION )[^;]+' CMakeLists.txt) echo "PGVER=${PGVER}" >> $GITHUB_ENV echo "PGPORT=5432" >> $GITHUB_ENV - echo "PGIS=3" >> $GITHUB_ENV echo "PROJECT_VERSION=${PROJECT_VERSION}" >> $GITHUB_ENV - echo "VROOMVER=1.12.0" >> $GITHUB_ENV - name: Verify Tag Name run: | @@ -54,7 +55,7 @@ jobs: $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - name: Install python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' @@ -63,8 +64,8 @@ jobs: sudo apt-get update sudo apt-get install -y \ postgresql-${PGVER} \ - postgresql-${PGVER}-postgis-${PGIS} \ - postgresql-${PGVER}-postgis-${PGIS}-scripts \ + postgresql-${PGVER}-postgis-${{ env.postgis }} \ + postgresql-${PGVER}-postgis-${{ env.postgis }}-scripts \ postgresql-server-dev-${PGVER} \ graphviz \ doxygen @@ -76,35 +77,41 @@ jobs: run: | sudo apt-get install libssl-dev libasio-dev libglpk-dev + - name: Install Google OR-Tools dependencies + run: | + sudo pip install --root=/ ortools + - name: Cache VROOM id: cache-vroom - uses: actions/cache@v2 + uses: actions/cache@v4 env: cache-name: vroom with: - path: | - ~/vroom-${{ env.VROOMVER }} - key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.VROOMVER }} + path: vroom-${{ env.vroom }} + key: ${{ matrix.os }}-${{ env.cache-name }}-${{ env.vroom }} + + - name: Checkout VROOM + if: steps.cache-vroom.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + path: vroom-${{ env.vroom }} + repository: VROOM-Project/vroom + ref: "v${{ env.vroom }}" + submodules: true - name: Build VROOM if: steps.cache-vroom.outputs.cache-hit != 'true' run: | - git clone --depth 1 --branch v${{ env.VROOMVER }} https://github.com/VROOM-Project/vroom ~/vroom-${{ env.VROOMVER }} - - # init the required submodules - cd ~/vroom-${{ env.VROOMVER }}/ - git submodule update --init - - # Using "shared" target for creating Position Independent Code, disabling use of routing - cd ~/vroom-${{ env.VROOMVER }}/src + cd vroom-${{ env.vroom }}/src USE_ROUTING=false make shared - name: Configure run: | export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH + VROOM=$(pwd)/vroom-${{ env.vroom }} mkdir build cd build - 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 }} .. + cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM} .. - name: Build run: |