Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ Download the latest and greatest pre-built binaries from here https://github.com
and then add them to your `PATH`, probably renaming the binary to just `acci-ping` and then you're ready to
go!

Or use:
```sh
go install github.com/Lexer747/acci-ping@v1.0.3
```
To build and install locally via the `go install` toolchain

<details>
<summary><b>🪟 Windows</b></summary>

Expand Down Expand Up @@ -127,8 +133,6 @@ sudo sysctl -w net.ipv4.ping_group_range="1 0"
```
</details>



## About

This binary relies on [golang.org/x/net/icmp](https://pkg.go.dev/golang.org/x/net/icmp) and the stdlib `net`
Expand Down
24 changes: 17 additions & 7 deletions releases/do-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#
# SPDX-License-Identifier: GPL-2.0-only

set -x

ROOT=$(git rev-parse --show-toplevel)
SCRIPT_DIR="$ROOT"/releases/
TOOLS_DIR="$ROOT"/tools/
Expand All @@ -14,6 +16,9 @@ TIMESTAMP=$(date --rfc-3339=ns)
MINOR=${1:-"no"}
PATCH=${2:-"yes"}

VERSION=$(cat "$SCRIPT_DIR"version.txt)
BEFORE_README="go install github.com/Lexer747/acci-ping@v$VERSION"

if [[ "$MINOR" == "yes" ]]; then
PATCH="yes"
fi
Expand All @@ -22,7 +27,7 @@ function increment {
MINOR=$1
PATCH=$2
SCRIPT_DIR=$3
VERSION=$(cat "$SCRIPT_DIR"/version.txt)
VERSION=$(cat "$SCRIPT_DIR"version.txt)
IFS='.' read -ra ADDR <<< "$VERSION"
if [[ "$PATCH" == "yes" ]]; then
(( ADDR[2]++ ))
Expand All @@ -31,18 +36,23 @@ function increment {
(( ADDR[1]++ ))
ADDR[2]="0"
fi
echo "${ADDR[0]}.${ADDR[1]}.${ADDR[2]}" > "$SCRIPT_DIR"/version.txt
echo "${ADDR[0]}.${ADDR[1]}.${ADDR[2]}" > "$SCRIPT_DIR"version.txt
}

increment "$MINOR" "$PATCH" "$SCRIPT_DIR"

VERSION=$(cat "$SCRIPT_DIR"/version.txt)
VERSION=$(cat "$SCRIPT_DIR"version.txt)

git add "$SCRIPT_DIR"/version.txt
git commit -m "New release $VERSION"
AFTER_README="go install github.com/Lexer747/acci-ping@v$VERSION"

git tag -a "$VERSION" -m "Tagged automatically by do-release.sh at $TIMESTAMP"
git add "$SCRIPT_DIR"version.txt
git commit -m "New release v$VERSION"

git tag -a "v$VERSION" -m "Tagged automatically by do-release.sh at $TIMESTAMP"

"$TOOLS_DIR"/build.sh sign

cp "$ROOT/out/linux/amd64/acci-ping-linux-amd64" "$HOME/go/bin/acci-ping"
cp "$ROOT/out/linux/amd64/acci-ping-linux-amd64" "$HOME/go/bin/acci-ping"

sed "s\\$BEFORE_README\\$AFTER_README\\g" <README.md >README.tmp.md
mv README.tmp.md README.md