Skip to content

Commit 66ee9bc

Browse files
committed
Split binary archives to ameliorate goreleaser warning
1 parent ed5c501 commit 66ee9bc

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.github/workflows/test-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
args: --clean --snapshot
8989
- name: Copy files (Ubuntu)
9090
run: |
91-
cp dist/pelican_linux_amd64_v1/${{ inputs.binary_name }} ./
91+
cp dist/${{ inputs.binary_name }}_linux_amd64_v1/${{ inputs.binary_name }} ./
9292
- name: Run Integration Tests
9393
run: ./github_scripts/citests.sh
9494
- name: Run End-to-End Test for Object get/put

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515
with:
16+
# Do fetch depth 0 here because otherwise goreleaser might not work properly:
17+
# https://goreleaser.com/ci/actions/?h=tag#workflow
1618
fetch-depth: 0
1719
- uses: actions/setup-node@v4
1820
with:
@@ -23,7 +25,9 @@ jobs:
2325
path: |
2426
~/.npm
2527
${{ github.workspace }}/.next/cache
28+
# Generate a new cache whenever packages or source files change.
2629
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '!**/node_modules/**') }}
30+
# If source files changed but packages didn't, rebuild from a prior cache.
2731
restore-keys: |
2832
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
2933
- name: Install Go
@@ -46,6 +50,7 @@ jobs:
4650
- name: Run GoReleaser for Non-Ubuntu
4751
uses: goreleaser/goreleaser-action@v5
4852
with:
53+
# either 'goreleaser' (default) or 'goreleaser-pro'
4954
distribution: goreleaser
5055
version: latest
5156
args: build --single-target --clean --snapshot

.goreleaser.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ builds:
6767
- lotman
6868
ldflags:
6969
- -s -w -X github.com/pelicanplatform/pelican/config.commit={{.Commit}} -X github.com/pelicanplatform/pelican/config.date={{.Date}} -X github.com/pelicanplatform/pelican/config.builtBy=goreleaser -X github.com/pelicanplatform/pelican/config.version={{.Version}}
70+
# Goreleaser complains if there's a different number of binaries built for different architectures
71+
# in the same archive. Instead of plopping pelican-server in the same archive as pelican, split the
72+
# builds into separate archives.
7073
archives:
7174
- id: pelican
75+
builds:
76+
- pelican
7277
name_template: >-
7378
{{ .ProjectName }}_
7479
{{- title .Os }}_
@@ -78,6 +83,15 @@ archives:
7883
- goos: windows
7984
format: zip
8085
wrap_in_directory: '{{ .ProjectName }}-{{ trimsuffix .Version "-next" }}'
86+
- id: pelican-server
87+
builds:
88+
- pelican-server
89+
name_template: >-
90+
{{ .ProjectName }}-server_
91+
{{- title .Os }}_
92+
{{- if eq .Arch "amd64" }}x86_64
93+
{{- else }}{{ .Arch }}{{ end }}
94+
wrap_in_directory: '{{ .ProjectName }}-server-{{ trimsuffix .Version "-next" }}'
8195
checksum:
8296
name_template: 'checksums.txt'
8397
snapshot:

0 commit comments

Comments
 (0)