Skip to content

Commit 3e823d2

Browse files
authored
upgrade go mod version to v5 (#116)
1 parent cac06a8 commit 3e823d2

73 files changed

Lines changed: 215 additions & 191 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
module="$(awk '/^module /{print $2}' go.mod)"
5+
mod_major="1"
6+
if [[ "$module" =~ /v([0-9]+)$ ]]; then
7+
mod_major="${BASH_REMATCH[1]}"
8+
fi
9+
10+
tag="${GITHUB_REF_NAME}"
11+
if [[ "$tag" =~ ^v([0-9]+)\. ]]; then
12+
tag_major="${BASH_REMATCH[1]}"
13+
else
14+
echo "::error ::Tag must start with v<major>., got: ${tag}"
15+
exit 1
16+
fi
17+
18+
if [[ "$tag_major" != "$mod_major" ]]; then
19+
echo "::error ::Tag major v${tag_major} does not match go.mod module major v${mod_major} (${module})"
20+
exit 1
21+
fi

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
go install
2020
git diff --exit-code
2121
- run: go build
22-
- run: go build github.com/loilo-inc/canarycage/cli/cage
22+
- run: go build github.com/loilo-inc/canarycage/v5/cli/cage
2323
- run: go test ./... -coverprofile=coverage.txt -covermode=count
2424
- uses: codecov/codecov-action@v5
2525
# skip if pr from dependabot, as it doesn't have access to secrets

.github/workflows/tag.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
- uses: actions/setup-go@v6
1717
with:
1818
go-version-file: "go.mod"
19+
- name: Validate tag major matches go.mod module
20+
run: ./.github/scripts/validate-tag-major.sh
1921
- name: Release
2022
uses: goreleaser/goreleaser-action@v6
2123
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
.idea/
1616
dist/
17+
/cage
1718

1819
coverage.txt
1920

cage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package cage
22

33
import (
4-
"github.com/loilo-inc/canarycage/key"
5-
"github.com/loilo-inc/canarycage/logger"
6-
"github.com/loilo-inc/canarycage/types"
4+
"github.com/loilo-inc/canarycage/v5/key"
5+
"github.com/loilo-inc/canarycage/v5/logger"
6+
"github.com/loilo-inc/canarycage/v5/types"
77
"github.com/loilo-inc/logos/di"
88
)
99

cli/cage/audit/aggregator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"sort"
66

77
ecrtypes "github.com/aws/aws-sdk-go-v2/service/ecr/types"
8-
"github.com/loilo-inc/canarycage/logger"
8+
"github.com/loilo-inc/canarycage/v5/logger"
99
"github.com/loilo-inc/logos/v2/set"
1010
)
1111

cli/cage/audit/command.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package audit
33
import (
44
"context"
55

6-
"github.com/loilo-inc/canarycage/cli/cage/cageapp"
7-
"github.com/loilo-inc/canarycage/key"
8-
"github.com/loilo-inc/canarycage/logger"
9-
"github.com/loilo-inc/canarycage/types"
6+
"github.com/loilo-inc/canarycage/v5/cli/cage/cageapp"
7+
"github.com/loilo-inc/canarycage/v5/key"
8+
"github.com/loilo-inc/canarycage/v5/logger"
9+
"github.com/loilo-inc/canarycage/v5/types"
1010
"github.com/loilo-inc/logos/di"
1111
)
1212

cli/cage/audit/command_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import (
55
"encoding/json"
66
"testing"
77

8-
"github.com/loilo-inc/canarycage/cli/cage/audit"
9-
"github.com/loilo-inc/canarycage/cli/cage/cageapp"
10-
"github.com/loilo-inc/canarycage/key"
11-
"github.com/loilo-inc/canarycage/mocks/mock_audit"
12-
"github.com/loilo-inc/canarycage/test"
8+
"github.com/loilo-inc/canarycage/v5/cli/cage/audit"
9+
"github.com/loilo-inc/canarycage/v5/cli/cage/cageapp"
10+
"github.com/loilo-inc/canarycage/v5/key"
11+
"github.com/loilo-inc/canarycage/v5/mocks/mock_audit"
12+
"github.com/loilo-inc/canarycage/v5/test"
1313
"github.com/loilo-inc/logos/di"
1414
"github.com/stretchr/testify/assert"
1515
"go.uber.org/mock/gomock"

cli/cage/audit/deps.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
"github.com/aws/aws-sdk-go-v2/config"
88
"github.com/aws/aws-sdk-go-v2/service/ecr"
99
"github.com/aws/aws-sdk-go-v2/service/ecs"
10-
"github.com/loilo-inc/canarycage/awsiface"
11-
"github.com/loilo-inc/canarycage/cli/cage/cageapp"
12-
"github.com/loilo-inc/canarycage/key"
13-
"github.com/loilo-inc/canarycage/logger"
14-
"github.com/loilo-inc/canarycage/timeout"
15-
"github.com/loilo-inc/canarycage/types"
10+
"github.com/loilo-inc/canarycage/v5/awsiface"
11+
"github.com/loilo-inc/canarycage/v5/cli/cage/cageapp"
12+
"github.com/loilo-inc/canarycage/v5/key"
13+
"github.com/loilo-inc/canarycage/v5/logger"
14+
"github.com/loilo-inc/canarycage/v5/timeout"
15+
"github.com/loilo-inc/canarycage/v5/types"
1616
"github.com/loilo-inc/logos/di"
1717
)
1818

cli/cage/audit/deps_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"testing"
66

7-
"github.com/loilo-inc/canarycage/cli/cage/cageapp"
7+
"github.com/loilo-inc/canarycage/v5/cli/cage/cageapp"
88
)
99

1010
func TestProvideAuditCmd(t *testing.T) {

0 commit comments

Comments
 (0)