Skip to content

Commit e1a44be

Browse files
committed
Update release actions
1 parent 7f51b7b commit e1a44be

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- 'v*.*.*'
7-
4+
workflow_dispatch:
85

96
permissions:
107
contents: read
@@ -25,6 +22,11 @@ jobs:
2522
with:
2623
fetch-depth: 0
2724

25+
- name: Initialize mandatory git config
26+
run: |
27+
git config user.name "github-actions[bot]"
28+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
29+
2830
- name: Get postgres version
2931
run: |
3032
sudo service postgresql start
@@ -34,17 +36,14 @@ jobs:
3436
echo "PGPORT=5432" >> $GITHUB_ENV
3537
echo "PGIS=3" >> $GITHUB_ENV
3638
echo "PGROUTING_VERSION=${PGROUTING_VERSION}" >> $GITHUB_ENV
39+
echo "TAG_NAME=v${PGROUTING_VERSION}" >> $GITHUB_ENV
3740
38-
- name: Verify Tag Name
41+
- name: Create and Push Tag
3942
run: |
40-
TAG_NAME=${GITHUB_REF#refs/*/}
41-
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
42-
echo ${TAG_NAME}
43-
echo ${PGROUTING_VERSION}
44-
if [ "${TAG_NAME}" != "v${PGROUTING_VERSION}" ]; then
45-
echo "Tag name should be v${PGROUTING_VERSION}"
46-
exit 1
47-
fi
43+
git tag -a "${TAG_NAME}" -m "Release version ${TAG_NAME}"
44+
git push origin "${TAG_NAME}"
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4847

4948
- name: Extract branch name and commit hash
5049
run: |
@@ -88,7 +87,7 @@ jobs:
8887
mkdir build
8988
cd build
9089
cmake -DPOSTGRESQL_VERSION=${PGVER} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DCMAKE_BUILD_TYPE=Release \
91-
-DES=ON -DZH_HANS=ON..
90+
-DES=ON -DZH_HANS=ON ..
9291
9392
- name: Build
9493
run: |
@@ -98,11 +97,6 @@ jobs:
9897
sudo make install
9998
make doxy
10099
101-
- name: Initialize mandatory git config
102-
run: |
103-
git config user.name "github-actions[bot]"
104-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
105-
106100
- name: Update Users Documentation
107101
run: |
108102
git checkout origin/gh-pages

0 commit comments

Comments
 (0)