From 66ee9bce83937a0619c5c526e2b270a81d5c7787 Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Thu, 21 Nov 2024 16:30:44 +0000 Subject: [PATCH] Split binary archives to ameliorate goreleaser warning --- .github/workflows/test-template.yml | 2 +- .github/workflows/test.yml | 5 +++++ .goreleaser.yml | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-template.yml b/.github/workflows/test-template.yml index cfb832961..ff3204ddc 100644 --- a/.github/workflows/test-template.yml +++ b/.github/workflows/test-template.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa3ab6734..0804df90f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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 @@ -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 diff --git a/.goreleaser.yml b/.goreleaser.yml index f6d0174b9..5ae8b446f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 }}_ @@ -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: