Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
FlavienMontois committed May 31, 2024
1 parent 548d94e commit 8ad5e60
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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=flavien.montois@botify.com 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
1 change: 1 addition & 0 deletions debian/manpages/aws-vpn.1
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Print if the VPN is up or down
The OpenVPN configuration file needs to be:
.B /etc/aws\-vpn.conf
.SH FILES
.TP
.B /usr/bin/aws\-vpn
.TP
.B /usr/share/aws\-vpn/server.go
Expand Down
2 changes: 1 addition & 1 deletion usr/bin/aws-vpn
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ esac

# Check if the configuration file exists
if [[ ! -f ${OVPN_CONF} ]]; then
echo -e "\033[0;31mconfiguration file does not exist, it must be: \033[m$'{OVPN_CONF}'" >&3
echo -e "\033[0;31mconfiguration file does not exist, it must be: \033[m'${OVPN_CONF}'" >&3
exit 1
fi

Expand Down

0 comments on commit 8ad5e60

Please sign in to comment.