Skip to content

Commit e2cfb51

Browse files
authored
chore: Dependency and Release Updates (#45)
* use `v6` of setup-go * bump go version * update build steps * update release * update helper scripts * remove deadcode for now
1 parent 9e8948c commit e2cfb51

File tree

13 files changed

+74
-43
lines changed

13 files changed

+74
-43
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ jobs:
1818
persist-credentials: false
1919

2020
- name: setup go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@v6
2222
with:
2323
go-version-file: 'go.mod'
2424
cache: true
2525

26-
- name: goreleaser
27-
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # pin@v6
26+
- name: setup goreleaser
27+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # pin@v6.4.0
2828
with:
2929
install-only: true
30+
version: '~> v2'
3031

3132
- name: bootstrap
3233
run: script/bootstrap

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
persist-credentials: false
1717

1818
- name: setup go
19-
uses: actions/setup-go@v5
19+
uses: actions/setup-go@v6
2020
with:
2121
go-version-file: 'go.mod'

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
persist-credentials: false
1919

2020
- name: setup go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@v6
2222
with:
2323
go-version-file: 'go.mod'
2424
cache: true

.github/workflows/lint.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
persist-credentials: false
1919

2020
- name: setup go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@v6
2222
with:
2323
go-version-file: 'go.mod'
2424
cache: true
@@ -44,14 +44,3 @@ jobs:
4444
assert-nothing-changed go mod tidy
4545
4646
exit $STATUS
47-
48-
- name: deadcode
49-
run: |
50-
go install golang.org/x/tools/cmd/deadcode@latest
51-
52-
deadcode -test ./... > "deadcode.txt"
53-
if [ -s "deadcode.txt" ]; then
54-
echo "dead code found:"
55-
cat deadcode.txt
56-
exit 1
57-
fi

.github/workflows/release.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,47 @@ jobs:
1515
runs-on: ubuntu-latest
1616
outputs:
1717
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
18+
artifact_dir: ${{ steps.build.outputs.artifact_dir }}
1819

1920
steps:
2021
- name: checkout
21-
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # pin@v4
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # pin@v5.0.0
2223
with:
2324
fetch-depth: 0
2425
persist-credentials: false
2526

2627
- name: setup go
27-
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # pin@v5
28+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # pin@v6
2829
with:
2930
go-version-file: "go.mod"
3031
cache: false
3132

3233
- name: bootstrap
3334
run: script/bootstrap
3435

35-
- name: goreleaser
36-
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # pin@v6
36+
- name: setup goreleaser
37+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # pin@v6.4.0
3738
with:
38-
args: release --clean
39+
install-only: true
40+
version: '~> v2'
41+
42+
# IMPORTANT: this step MUST export for the following outputs:
43+
# artifact_dir: the path to the dir where artifacts are stored - ex: "dist"
44+
# Note: this step will build the binaries via goreleaser, place the artifacts in a dir (ex: "dist"), and then export that path as artifact_dir...
45+
# ... finally it will then publish a GitHub Release with those artifacts attached
46+
- name: build and release
47+
id: build
3948
env:
4049
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: script/build --release
4151

4252
- name: upload artifact
43-
uses: actions/upload-artifact@v4.6.2
53+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # pin@v4.6.2
4454
id: upload-artifact
4555
with:
46-
path: dist/
56+
name: ${{ steps.build.outputs.artifact_dir }} # name and path can just both be artifact_dir (ex: "dist") to keep it simple
57+
path: ${{ steps.build.outputs.artifact_dir }}
58+
if-no-files-found: error
4759

4860
sign:
4961
needs: release
@@ -53,29 +65,36 @@ jobs:
5365
attestations: write
5466
contents: read
5567
steps:
56-
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
68+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0
5769
with:
5870
artifact-ids: ${{ needs.release.outputs.artifact-id }}
71+
path: ${{ needs.release.outputs.artifact_dir }}
72+
73+
- name: view artifact
74+
env:
75+
ARTIFACT_PATH: ${{ needs.release.outputs.artifact_dir }}
76+
run: tree -L 2 -a --dirsfirst -C -F -h -D "${ARTIFACT_PATH}"
5977

6078
- name: attest build provenance
61-
uses: actions/attest-build-provenance@v3.0.0
79+
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # pin@v3.0.0
6280
with:
63-
subject-path: "."
81+
subject-path: "${{ needs.release.outputs.artifact_dir }}/"
6482

6583
verify:
6684
permissions: {}
6785
runs-on: ubuntu-latest
6886
needs: [release, sign]
6987
steps:
70-
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
88+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # pin@v5.0.0
7189
with:
7290
artifact-ids: ${{ needs.release.outputs.artifact-id }}
91+
path: ${{ needs.release.outputs.artifact_dir }}
7392

7493
- name: verify
7594
env:
7695
OWNER: ${{ github.repository_owner }}
7796
REPO: ${{ github.event.repository.name }}
78-
ARTIFACT_PATH: "."
97+
ARTIFACT_PATH: "${{ needs.release.outputs.artifact_dir }}/"
7998
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8099
run: |
81100
echo "Scanning for files in $ARTIFACT_PATH"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
persist-credentials: false
1919

2020
- name: setup go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@v6
2222
with:
2323
go-version-file: 'go.mod'
2424
cache: true

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.23.8
1+
1.25.1

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/github/gh-combine
22

3-
go 1.23.8
3+
go 1.25.1
44

55
require github.com/briandowns/spinner v1.23.2
66

script/bootstrap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ echo -e "${BLUE}🥾 Bootstrapping...${OFF}"
88

99
# Hermetic check: ensure all imports resolve from vendor/ only
1010
# This avoids touching the network or the module cache.
11+
# This command will fail if the project is not fully vendored.
1112
go list -mod=vendor -deps ./... > /dev/null
1213

1314
echo -e "${GREEN}✅ Bootstrap complete!${OFF}"

script/build

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,26 @@ BUILD_TIME="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
1212

1313
goreleaser check
1414

15-
# Pass all arguments through to goreleaser build
16-
goreleaser build --snapshot --clean "$@"
15+
# Check if --release flag is passed
16+
if [[ " $* " == *" --release "* ]]; then
17+
# Remove --release from arguments and run goreleaser in release mode
18+
args=("$@")
19+
filtered_args=()
20+
for arg in "${args[@]}"; do
21+
if [[ "$arg" != "--release" ]]; then
22+
filtered_args+=("$arg")
23+
fi
24+
done
25+
26+
goreleaser release --clean "${filtered_args[@]}"
27+
else
28+
# Default: Pass all arguments through to goreleaser build in snapshot mode
29+
goreleaser build --snapshot --clean "$@"
30+
fi
31+
32+
if [[ "$CI" == "true" ]]; then
33+
tree -L 2 -a --dirsfirst -C -F -h -D dist/
34+
echo "artifact_dir=dist" >> $GITHUB_OUTPUT
35+
fi
1736

1837
echo -e "${GREEN}Build completed successfully!${OFF}"

0 commit comments

Comments
 (0)