-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (51 loc) · 1.9 KB
/
release.yml
File metadata and controls
61 lines (51 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: REL
on:
push:
tags: ["v[0-9]*"]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build tarball
id: build
run: |
sudo -nH apt-get -u -y install pandoc autoconf automake libtool \
libevent-dev libpq-dev patchutils python3-docutils
./autogen.sh
./configure
make checkver
make dist
PACKAGE=$(grep ^PACKAGE_NAME config.mak | sed 's/.*= *//')
VERSION=$(grep ^PACKAGE_VERSION config.mak | sed 's/.*= *//')
# default - gh:release
# PRERELEASE - gh:prerelease
# DRAFT - gh:draft,prerelease
PRERELEASE="false"
DRAFT="false"
if echo "${VERSION}" | grep -qE '(a|b|rc)'; then PRERELEASE="true"; fi
if echo "${VERSION}" | grep -qE '(dev)'; then DRAFT="true"; PRERELEASE="true"; fi
test "${{github.ref}}" = "refs/tags/v${VERSION}" || { echo "ERR: tag mismatch"; exit 1; }
echo "PACKAGE=${PACKAGE}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "TGZ=${PACKAGE}-${VERSION}.tar.gz" >> $GITHUB_ENV
echo "PRERELEASE=${PRERELEASE}" >> $GITHUB_ENV
echo "DRAFT=${DRAFT}" >> $GITHUB_ENV
pandoc --version
mkdir -p tmp
make -s shownote > tmp/note.md
cat tmp/note.md
- name: "Create Github release"
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
title="${PACKAGE} v${VERSION}"
ghf="--notes-file=tmp/note.md"
if test "${DRAFT}" = "true"; then ghf="${ghf} --draft"; fi
if test "${PRERELEASE}" = "true"; then ghf="${ghf} --prerelease"; fi
gh release create "v${VERSION}" "${TGZ}" --title="${title}" ${ghf}