Skip to content

Commit 62aafac

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 62aafac

File tree

87 files changed

+5371
-537
lines changed

Some content is hidden

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

87 files changed

+5371
-537
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-file: 'go.work'
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: 'go.work'
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: 'go.work'
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-file: ./src/github.com/${{ github.repository }}/go.work
3434
check-latest: true
3535

3636
- name: Install ko

.github/workflows/test-action-tuf.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ jobs:
3737
steps:
3838
- name: Checkout the current action
3939
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
40+
path: ./src/github.com/sigstore/scaffolding
4041
with:
4142
persist-credentials: false
4243
- name: Test running the action
43-
uses: ./actions/setup
44+
uses: ./src/github.com/sigstore/scaffolding/actions/setup
4445
with:
4546
k8s-version: ${{ matrix.k8s-version }}
4647
version: ${{ matrix.release-version }}
48+
working-directory: ./src/github.com/sigstore/scaffolding
4749

4850
# Install cosign
4951
- name: Install cosign

.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: 20 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-file: 'go.work'
2323
check-latest: true
2424
cache: true
2525

@@ -42,20 +42,38 @@ 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51+
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
52+
with:
53+
go-version-file: 'go.work'
54+
check-latest: true
55+
- id: set-modules
56+
run: echo "modules=$(go list -m -json | jq -s 'del(.[] | select(.Path == "github.com/sigstore/scaffolding/hack"))' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT
57+
4558
golangci:
4659
name: lint
60+
needs: detect-modules
4761
runs-on: ubuntu-latest
62+
strategy:
63+
matrix:
64+
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
4865
steps:
4966
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5067
with:
5168
persist-credentials: false
5269

5370
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
5471
with:
55-
go-version-file: 'go.mod'
72+
go-version-file: 'go.work'
5673
check-latest: true
5774

5875
- name: golangci-lint
5976
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47 # v9.0.0
6077
with:
6178
version: v2.4
79+
working-directory: ${{ matrix.modules }}

0 commit comments

Comments
 (0)