Skip to content

Commit 2d8ad83

Browse files
committed
release-cleanup
- add checksums, - revert to the old format for binary names Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
1 parent b180bc3 commit 2d8ad83

File tree

6 files changed

+48
-12
lines changed

6 files changed

+48
-12
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ jobs:
1414
build:
1515
name: Build Binaries
1616
runs-on: ubuntu-latest
17+
env:
18+
GOTOOLCHAIN: auto
19+
1720
steps:
1821
- name: Checkout code
1922
uses: actions/checkout@v4
2023

2124
- name: Set up Go
2225
uses: actions/setup-go@v5
2326
with:
24-
go-version: "1.26"
27+
go-version-file: go.mod
2528
cache: true
2629

2730
- name: Build binaries
@@ -48,6 +51,9 @@ jobs:
4851
test:
4952
name: Run Tests
5053
runs-on: ubuntu-latest
54+
env:
55+
GOTOOLCHAIN: auto
56+
5157
needs: build
5258
steps:
5359
- name: Checkout code
@@ -56,7 +62,7 @@ jobs:
5662
- name: Set up Go
5763
uses: actions/setup-go@v5
5864
with:
59-
go-version: "1.26"
65+
go-version-file: go.mod
6066
cache: true
6167

6268
- name: Run unit tests

.github/workflows/go.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ jobs:
1414
matrix:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
runs-on: ${{ matrix.os }}
17+
env:
18+
GOTOOLCHAIN: auto
19+
1720

1821
steps:
19-
- uses: actions/checkout@v6
22+
- uses: actions/checkout@v4
2023

2124
- name: Set up Go
22-
uses: actions/setup-go@v6
25+
uses: actions/setup-go@v5
2326
with:
2427
go-version-file: go.mod
2528

.github/workflows/pr.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ jobs:
2525
lint:
2626
name: Lint Code
2727
runs-on: ubuntu-latest
28+
env:
29+
GOTOOLCHAIN: auto
30+
2831
steps:
2932
- name: Checkout code
3033
uses: actions/checkout@v4
3134

3235
- name: Set up Go
3336
uses: actions/setup-go@v5
3437
with:
35-
go-version: "1.26"
38+
go-version-file: go.mod
3639
cache: true
3740

3841
- name: Run golangci-lint
@@ -41,14 +44,17 @@ jobs:
4144
unit-test:
4245
name: Unit Tests
4346
runs-on: ubuntu-latest
47+
env:
48+
GOTOOLCHAIN: auto
49+
4450
steps:
4551
- name: Checkout code
4652
uses: actions/checkout@v4
4753

4854
- name: Set up Go
4955
uses: actions/setup-go@v5
5056
with:
51-
go-version: "1.26"
57+
go-version-file: go.mod
5258
cache: true
5359

5460
- name: Run unit tests
@@ -57,14 +63,17 @@ jobs:
5763
integration-test:
5864
name: Integration Tests
5965
runs-on: ubuntu-latest
66+
env:
67+
GOTOOLCHAIN: auto
68+
6069
steps:
6170
- name: Checkout code
6271
uses: actions/checkout@v4
6372

6473
- name: Set up Go
6574
uses: actions/setup-go@v5
6675
with:
67-
go-version: "1.26"
76+
go-version-file: go.mod
6877
cache: true
6978

7079
- name: Run integration tests
@@ -75,14 +84,17 @@ jobs:
7584
security-scan:
7685
name: Security Scan
7786
runs-on: ubuntu-latest
87+
env:
88+
GOTOOLCHAIN: auto
89+
7890
steps:
7991
- name: Checkout code
8092
uses: actions/checkout@v4
8193

8294
- name: Set up Go
8395
uses: actions/setup-go@v5
8496
with:
85-
go-version: "1.26"
97+
go-version-file: go.mod
8698
cache: true
8799

88100
- name: Install govulncheck

.github/workflows/release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,37 @@ jobs:
1515
build:
1616
name: Build Release Binaries
1717
runs-on: ubuntu-latest
18+
env:
19+
GOTOOLCHAIN: auto
20+
1821
steps:
1922
- name: Checkout code
2023
uses: actions/checkout@v4
2124

2225
- name: Set up Go
2326
uses: actions/setup-go@v5
2427
with:
25-
go-version: "1.25"
28+
go-version-file: go.mod
2629

2730
- name: Build binaries
2831
run: |
2932
mkdir -p dist
30-
platforms=("linux/amd64" "linux/arm64" "windows/amd64" "windows/arm64" "darwin/amd64" "darwin/arm64")
33+
VERSION=${{ github.ref_name }}
34+
platforms=("linux/amd64" "linux/arm64" "windows/amd64" "windows/arm64" "darwin/amd64" "darwin/arm64" "freebsd/amd64" "freebsd/arm64")
3135
for platform in "${platforms[@]}"; do
3236
GOOS=${platform%/*}
3337
GOARCH=${platform#*/}
34-
output_name="dist/launchpad_${GOOS}_${GOARCH}"
38+
output_name="dist/launchpad_${GOOS}_${GOARCH}_${VERSION#v}"
3539
if [ "$GOOS" = "windows" ]; then
3640
output_name+=".exe"
3741
fi
3842
echo "Building $output_name"
3943
GOOS=$GOOS GOARCH=$GOARCH go build -o "$output_name" ./main.go
4044
done
45+
- name: Generate checksums
46+
run: |
47+
cd dist
48+
sha256sum launchpad_* > checksums.sha256
4149
4250
- name: Upload artifacts
4351
uses: actions/upload-artifact@v4
@@ -68,4 +76,4 @@ jobs:
6876
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6977

7078
# TODO: Add Digicert signing here.
71-
# TODO: Push signed artifacts to S3 here.
79+
# TODO: Push signed artifacts to S3 here.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
# Ensure we use auto toolchain
3+
export GOTOOLCHAIN=auto
4+
5+
26
.PHONY: clean
37
clean:
48
rm -fr dist

version/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ func (a *Asset) IsForHost() bool {
4444
}
4545

4646
parts := strings.Split(strings.TrimSuffix(a.Name, ".exe"), "_")
47+
if len(parts) < 3 {
48+
return false
49+
}
4750
return parts[1] == runtime.GOOS && parts[2] == runtime.GOARCH
4851
}
4952

0 commit comments

Comments
 (0)