Skip to content

Commit 8999a11

Browse files
committed
Move commands to separate modules
Make each helper command its own module to avoid maintaining every tool's dependencies in a single go.mod. Also remove update-deps.sh and update-codegen.sh which weren't used anywhere. Signed-off-by: Colleen Murphy <[email protected]>
1 parent 30cdb2b commit 8999a11

File tree

86 files changed

+5367
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+5367
-536
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ updates:
2222
- "cloud-sql-proxy"
2323

2424
- package-ecosystem: gomod
25-
directory: "/"
25+
directories:
26+
- "/"
27+
- "/tools/*"
28+
- "/hack/"
2629
schedule:
2730
interval: weekly
2831
open-pull-requests-limit: 10

.github/workflows/add-remove-new-fulcio.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
GO111MODULE: on
4141
GOFLAGS: -ldflags=-s -ldflags=-w
4242
KO_DOCKER_REPO: registry.local:5000/knative
43-
KOCACHE: ~/ko
43+
KOCACHE: /home/runner/ko
4444

4545
steps:
4646
- uses: chainguard-dev/actions/setup-mirror@b479012116eacde7f895586c17b598f7ba0ee700 # v1.5.9
@@ -203,7 +203,7 @@ jobs:
203203

204204
- name: Verify both Fulcio certs are there
205205
run: |
206-
go run ./cmd/ctlog/verifyfulcio/main.go \
206+
go run ./tools/ctlog/cmd/ctlog/verifyfulcio/main.go \
207207
--ctlog-url ${CTLOG_URL} \
208208
--log-prefix sigstorescaffolding \
209209
--fulcio ${FULCIO_URL} \
@@ -232,7 +232,7 @@ jobs:
232232

233233
- name: Verify that only new Fulcio cert is there
234234
run: |
235-
go run ./cmd/ctlog/verifyfulcio/main.go \
235+
go run ./tools/ctlog/cmd/ctlog/verifyfulcio/main.go \
236236
--ctlog-url ${CTLOG_URL} \
237237
--log-prefix sigstorescaffolding \
238238
--fulcio ${NEW_FULCIO_URL}

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
filters: |
4040
gocode:
4141
- 'pkg/**'
42-
- 'cmd/**'
42+
- 'tools/**'
4343
4444
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
4545
with:
46-
go-version-file: 'go.mod'
46+
go-version: stable
4747

4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL

.github/workflows/create-tink-keyset-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'cmd/create-tink-keyset/**'
8+
- 'tools/create-tink-keyset/cmd/create-tink-keyset/**'
99

1010
permissions:
1111
contents: read
@@ -23,9 +23,9 @@ jobs:
2323
- name: Set up Go
2424
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
2525
with:
26-
go-version-file: 'go.mod'
26+
go-version-file: './tools/create-tink-keyset/go.mod'
2727
check-latest: true
2828

2929
- name: Create Tink Keyset build
3030
id: create-tink-keyset-test
31-
run: go build ./cmd/create-tink-keyset
31+
run: go build ./tools/create-tink-keyset/cmd/create-tink-keyset

.github/workflows/fulcio-rekor-kind.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
GO111MODULE: on
4141
GOFLAGS: -ldflags=-s -ldflags=-w
4242
KO_DOCKER_REPO: registry.local:5000/knative
43-
KOCACHE: ~/ko
43+
KOCACHE: /home/runner/ko
4444

4545
steps:
4646
- name: Check out our repo

.github/workflows/prober-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
branches:
77
- main
88
paths:
9-
- 'cmd/prober/**'
9+
- 'tools/prober/cmd/prober/**'
1010
pull_request:
1111
branches:
1212
- main
1313
paths:
14-
- 'cmd/prober/**'
14+
- 'tools/prober/cmd/prober/**'
1515

1616
permissions:
1717
contents: read
@@ -40,11 +40,11 @@ jobs:
4040
- name: Set up Go
4141
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
4242
with:
43-
go-version-file: 'go.mod'
43+
go-version-file: './tools/prober/go.mod'
4444
check-latest: true
4545

4646
- name: Build prober test
47-
run: go build ./cmd/prober
47+
run: go build ./tools/prober/cmd/prober
4848

4949
- name: Get test OIDC token
5050
uses: sigstore-conformance/extremely-dangerous-public-oidc-beacon@main

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
3232
with:
33-
go-version-file: ./src/github.com/${{ github.repository }}/go.mod
33+
go-version: stable
3434
check-latest: true
3535

3636
- name: Install ko

.github/workflows/test-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
env:
3434
RELEASE_VERSION: "v0.7.22"
3535
KO_DOCKER_REPO: registry.local:5000/knative
36-
KOCACHE: ~/ko
36+
KOCACHE: /home/runner/ko
3737

3838
steps:
3939
- uses: chainguard-dev/actions/setup-mirror@b479012116eacde7f895586c17b598f7ba0ee700 # v1.5.9

.github/workflows/verify.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
2121
with:
22-
go-version-file: 'go.mod'
22+
go-version: stable
2323
check-latest: true
2424
cache: true
2525

@@ -42,20 +42,37 @@ jobs:
4242
- name: Run ShellCheck
4343
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
4444

45+
detect-modules:
46+
runs-on: ubuntu-latest
47+
outputs:
48+
modules: ${{ steps.set-modules.outputs.modules }}
49+
steps:
50+
- uses: actions/checkout@v5
51+
- uses: actions/setup-go@v6
52+
with:
53+
go-version: stable
54+
- id: set-modules
55+
run: echo "modules=$(go list -m -json | jq -s 'del(.[] | select(.Path == "github.com/sigstore/scaffolding/hack"))' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT
56+
4557
golangci:
4658
name: lint
59+
needs: detect-modules
4760
runs-on: ubuntu-latest
61+
strategy:
62+
matrix:
63+
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
4864
steps:
4965
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5066
with:
5167
persist-credentials: false
5268

5369
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
5470
with:
55-
go-version-file: 'go.mod'
71+
go-version: stable
5672
check-latest: true
5773

5874
- name: golangci-lint
5975
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47 # v9.0.0
6076
with:
6177
version: v2.4
78+
working-directory: ${{ matrix.modules }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ release-*.yaml
55
testrelease.yaml
66
kind.yaml
77
.vscode/*
8-
prober
98
/cloudsqlproxy
109
/createcertchain
1110
/createcerts

0 commit comments

Comments
 (0)