File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ BASE_SHA=" ${1:- } "
5+ HEAD_SHA=" ${2:- } "
6+
7+ if [[ -z " $BASE_SHA " || -z " $HEAD_SHA " ]]; then
8+ echo " Usage: $0 <base-sha> <head-sha>"
9+ exit 1
10+ fi
11+
12+ git fetch --no-tags --depth=1 origin " $BASE_SHA " " $HEAD_SHA "
13+
14+ GO_CHANGED=" $( git diff --name-only " $BASE_SHA " " $HEAD_SHA " -- ' **/*.go' || true) "
15+ if [[ -z " $GO_CHANGED " ]]; then
16+ echo " No Go files changed; skipping version bump check."
17+ exit 0
18+ fi
19+
20+ BASE_VERSION=" $( git show " $BASE_SHA :aproxy.go" | sed -n ' s/^var version = "\([^"]*\)"$/\1/p' | head -n1) "
21+ CURRENT_VERSION=" $( sed -n ' s/^var version = "\([^"]*\)"$/\1/p' aproxy.go | head -n1) "
22+
23+ if [[ -z " $BASE_VERSION " ]]; then
24+ echo " Could not parse base version from aproxy.go at $BASE_SHA "
25+ exit 1
26+ fi
27+
28+ if [[ -z " $CURRENT_VERSION " ]]; then
29+ echo " Could not parse current version from aproxy.go"
30+ exit 1
31+ fi
32+
33+ LATEST=" $( printf ' %s\n%s\n' " $BASE_VERSION " " $CURRENT_VERSION " | sort -V | tail -n1) "
34+ if [[ " $CURRENT_VERSION " == " $BASE_VERSION " || " $LATEST " != " $CURRENT_VERSION " ]]; then
35+ echo " Go files changed but version was not bumped."
36+ echo " Base version: $BASE_VERSION "
37+ echo " Current version: $CURRENT_VERSION "
38+ echo " Please bump var version in aproxy.go when modifying Go source files."
39+ exit 1
40+ fi
41+
42+ echo " Version bump check passed: $BASE_VERSION -> $CURRENT_VERSION "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ SNAP_VERSION=" $( sed -n ' s/^version:[[:space:]]*\(.*\)$/\1/p' snap/snapcraft.yaml | head -n1 | tr -d ' "' | xargs) "
5+ GO_VERSION=" $( sed -n ' s/^var version = "\([^"]*\)"$/\1/p' aproxy.go | head -n1) "
6+
7+ if [[ -z " $SNAP_VERSION " ]]; then
8+ echo " Could not parse version from snap/snapcraft.yaml"
9+ exit 1
10+ fi
11+
12+ if [[ -z " $GO_VERSION " ]]; then
13+ echo " Could not parse version from aproxy.go"
14+ exit 1
15+ fi
16+
17+ if [[ " $SNAP_VERSION " != " $GO_VERSION " ]]; then
18+ echo " Version mismatch detected"
19+ echo " snap/snapcraft.yaml version: $SNAP_VERSION "
20+ echo " aproxy.go version: $GO_VERSION "
21+ echo " Keep both versions synchronized before merging or releasing."
22+ exit 1
23+ fi
24+
25+ echo " Version check passed: $GO_VERSION "
Original file line number Diff line number Diff line change 11name : Release
22
33on :
4- workflow_dispatch :
5- inputs :
6- tag :
7- description : ' Release tag (e.g., v1.0.0)'
8- required : true
9- type : string
4+ push :
5+ branches : [ main ]
106
117permissions :
128 contents : write
@@ -24,10 +20,19 @@ jobs:
2420 git config user.name "github-actions[bot]"
2521 git config user.email "github-actions[bot]@users.noreply.github.com"
2622
23+ - name : Validate Version Sync
24+ run : |
25+ bash .github/scripts/check-version-sync.sh
26+
2727 - name : Create tag
2828 id : tag
2929 run : |
30- TAG="${{ inputs.tag }}"
30+ GO_VERSION="$(sed -n 's/^var version = "\([^"]*\)"$/\1/p' aproxy.go | head -n1)"
31+ if [[ -z "$GO_VERSION" ]]; then
32+ echo "Could not parse version from aproxy.go"
33+ exit 1
34+ fi
35+ TAG="v${GO_VERSION}"
3136 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
3237 git tag -a "$TAG" -m "Release $TAG"
3338 git push origin "$TAG"
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ name: Tests
22
33on :
44 pull_request :
5- workflow_call :
65
76jobs :
87 test :
2221 go fmt ./...
2322 git diff --exit-code
2423
24+ - name : Check Version Sync
25+ run : |
26+ bash .github/scripts/check-version-sync.sh
27+
28+ - name : Check Version Bump For Go Changes
29+ run : |
30+ bash .github/scripts/check-go-version-bump.sh "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
31+
2532 - name : Build and Test
2633 run : |
2734 go test -race ./...
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import (
2424 "golang.org/x/crypto/cryptobyte"
2525)
2626
27- var version = "0.2.4 "
27+ var version = "1.0.1 "
2828
2929// PrereadConn is a wrapper around net.Conn that supports pre-reading from the underlying connection.
3030// Any Read before the EndPreread can be undone and read again by calling the EndPreread function.
Original file line number Diff line number Diff line change 11name : aproxy
2- version : 0.2.5
2+ version : 1.0.1
33summary : Transparent proxy for HTTP and HTTPS/TLS connections.
44description : |
55 Aproxy is a transparent proxy for HTTP and HTTPS/TLS connections. By
You can’t perform that action at this time.
0 commit comments