Skip to content

Commit

Permalink
Split binary archives to ameliorate goreleaser warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiemstrawisc committed Nov 21, 2024
1 parent ed5c501 commit 66ee9bc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
args: --clean --snapshot
- name: Copy files (Ubuntu)
run: |
cp dist/pelican_linux_amd64_v1/${{ inputs.binary_name }} ./
cp dist/${{ inputs.binary_name }}_linux_amd64_v1/${{ inputs.binary_name }} ./
- name: Run Integration Tests
run: ./github_scripts/citests.sh
- name: Run End-to-End Test for Object get/put
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
# Do fetch depth 0 here because otherwise goreleaser might not work properly:
# https://goreleaser.com/ci/actions/?h=tag#workflow
fetch-depth: 0
- uses: actions/setup-node@v4
with:
Expand All @@ -23,7 +25,9 @@ jobs:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '!**/node_modules/**') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Install Go
Expand All @@ -46,6 +50,7 @@ jobs:
- name: Run GoReleaser for Non-Ubuntu
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: build --single-target --clean --snapshot
Expand Down
14 changes: 14 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ builds:
- lotman
ldflags:
- -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}}
# Goreleaser complains if there's a different number of binaries built for different architectures
# in the same archive. Instead of plopping pelican-server in the same archive as pelican, split the
# builds into separate archives.
archives:
- id: pelican
builds:
- pelican
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
Expand All @@ -78,6 +83,15 @@ archives:
- goos: windows
format: zip
wrap_in_directory: '{{ .ProjectName }}-{{ trimsuffix .Version "-next" }}'
- id: pelican-server
builds:
- pelican-server
name_template: >-
{{ .ProjectName }}-server_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
wrap_in_directory: '{{ .ProjectName }}-server-{{ trimsuffix .Version "-next" }}'
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down

0 comments on commit 66ee9bc

Please sign in to comment.