forked from samm-git/aws-vpn-client
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (59 loc) · 1.92 KB
/
release.yml
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
61
62
63
64
65
66
67
68
69
70
71
name: CI
on:
push:
branches:
- "master"
pull_request:
jobs:
release-tag:
name: Release git tag
runs-on: ubuntu-latest
permissions:
contents: write
if: github.event_name == 'push'
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
-
name: Tag new minor release
id: tag
run: |
set -eux
# Get latest github tag
current=$(git tag | sort -h | tail -n 1)
if git describe --tags --exact-match HEAD; then
echo "On commit $current, tag ${SHA} already exists. Stopping here."
exit 0
fi
# Set new tag
major="$(echo $current | cut -d. -f1)"
minor="$(echo $current | cut -d. -f2)"
minor=$((minor + 1))
new_tag="${major}.${minor}"
### Build debian package
# Install dependencies
sudo apt install liblzo2-dev libpam0g-dev libnl-3-dev libnl-genl-3-dev libcap-ng-dev dh-make git-buildpackage
# Set new version
version=$(dpkg-parsechangelog --show-field Version)
major="$(echo $version | cut -d. -f1)"
minor="$(echo $version | cut -d. -f2)"
minor=$((minor + 1))
new_version="${major}.${minor}"
# Update changlog
[email protected] gbp dch --ignore-branch -N ${new_version}
# Build package
dpkg-buildpackage -b -rfakeroot -tc -us -uc
# Release tag and package
gh release create ${new_tag} --generate-notes --notes-start-tag ${current} ../aws-vpn_${new_version}_amd64.deb
env:
GH_TOKEN: ${{ github.token }}
SHA: ${{ github.sha }}
-
name: Commit changelog
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto update debian changelog