1- name : Publish Users Documentation
1+ name : Update Locale and Website
22
33on :
44 workflow_dispatch :
99
1010jobs :
1111 release :
12- name : Publish Users Documentation
12+ name : Update Locale and Website
1313 runs-on : ubuntu-latest
1414
1515 strategy :
@@ -30,11 +30,11 @@ jobs:
3030 echo "PGPORT=5432" >> $GITHUB_ENV
3131 echo "PGIS=3" >> $GITHUB_ENV
3232 echo "PROJECT_VERSION=${PROJECT_VERSION}" >> $GITHUB_ENV
33+ echo "VROOMVER=1.11.0" >> $GITHUB_ENV
3334
3435 - name : Extract branch name and commit hash
3536 run : |
36- raw=$(git branch -r --contains ${{ github.ref }})
37- branch=${raw##*/}
37+ branch=${GITHUB_REF#refs/heads/}
3838 echo "BRANCH=$branch" >> $GITHUB_ENV
3939 git_hash=$(git rev-parse --short "$GITHUB_SHA")
4040 echo "GIT_HASH=$git_hash" >> $GITHUB_ENV
@@ -63,37 +63,50 @@ jobs:
6363 graphviz \
6464 doxygen
6565 python -m pip install --upgrade pip
66- pip install Sphinx
67- pip install sphinx-bootstrap-theme
66+ pip install -r requirements.txt
67+ pip install sphinx-intl[transifex]
6868 pip list
6969
7070 - name : Install VROOM dependencies
7171 run : |
7272 sudo apt-get install libssl-dev libasio-dev libglpk-dev
7373
74- - name : Build VROOM v1.10.0
74+ - name : Cache VROOM
75+ id : cache-vroom
76+ uses : actions/cache@v2
77+ env :
78+ cache-name : vroom
79+ with :
80+ path : |
81+ ~/vroom-${{ env.VROOMVER }}
82+ key : ${{ runner.os }}-${{ env.cache-name }}-${{ env.VROOMVER }}
83+
84+ - name : Build VROOM
85+ if : steps.cache-vroom.outputs.cache-hit != 'true'
7586 run : |
76- wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v1.10.0 .tar.gz
77- tar -zvxf v1.10.0. tar.gz
78- cd vroom-1.10.0 /src
87+ wget https://github.com/VROOM-Project/vroom/archive/refs/tags/v${{ env.VROOMVER }}.tar.gz -O /tmp/${{ env.VROOMVER }} .tar.gz
88+ tar -zvxf /tmp/${{ env.VROOMVER }}. tar.gz -C ~/
89+ cd ~/ vroom-${{ env.VROOMVER }} /src
7990
8091 # Create object file with position independent code using -fPIC flag
8192 sed -i 's/CXXFLAGS = /CXXFLAGS = -fPIC /' makefile
8293
94+ cd ~/vroom-${{ env.VROOMVER }}/src
8395 make
84- cd ..
85- echo "VROOM_INSTALL_PATH=$(pwd)" >> $GITHUB_ENV
8696
8797 - name : Configure
8898 run : |
8999 export PATH=/usr/lib/postgresql/${PGVER}/bin:$PATH
90100 mkdir build
91101 cd build
92- cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DES=ON -DVROOM_INSTALL_PATH=${VROOM_INSTALL_PATH } ..
102+ cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release -DLOCALE=ON - DES=ON -DVROOM_INSTALL_PATH=$HOME/vroom-${{ env.VROOMVER } } ..
93103
94104 - name : Build
95105 run : |
96106 cd build
107+ if [[ "${{ env.BRANCH }}" == "develop" ]]; then
108+ make locale
109+ fi
97110 make doc
98111 make doxy
99112
@@ -102,6 +115,23 @@ jobs:
102115 git config user.name "github-actions[bot]"
103116 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
104117
118+ - name : Update locale
119+ if : github.ref == 'refs/heads/develop'
120+ run : |
121+ # List all the files that needs to be committed in build/doc/locale_changes.txt
122+ awk '/^Update|^Create/{print $2}' build/doc/locale_changes.txt > tmp && mv tmp build/doc/locale_changes.txt # .po files
123+ cat build/doc/locale_changes.txt | perl -pe 's/(.*)en\/LC_MESSAGES(.*)/$1pot$2t/' >> build/doc/locale_changes.txt # .pot files
124+ cat build/doc/locale_changes.txt
125+ # Remove obsolete entries #~ from .po files
126+ tools/transifex/remove_obsolete_entries.sh
127+ # Add the files, commit and push
128+ for line in `cat build/doc/locale_changes.txt`; do git add "$line"; done
129+ git diff --staged --quiet || git commit -m "Update locale: commit ${{ env.GIT_HASH }}"
130+ git fetch origin
131+ git reset --hard # Remove the unstaged changes before rebasing
132+ git rebase origin/develop
133+ git push origin develop
134+
105135 - name : Update Users Documentation
106136 run : |
107137 if [[ "${{ env.BRANCH }}" == "main" ]]; then
0 commit comments