Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inputs:
default: 'false'
outputs:
checksum_file:
description: path to the sha256 checksums file generated by goreleaser
description: path to the sha256 checksums file
value: ${{ steps.binary.outputs.checksum_file }}
images_and_digests:
description: built docker image names and digests in JSON format
Expand All @@ -36,44 +36,40 @@ runs:
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386
- name: Git clean
shell: bash
run: git clean -f
- name: Login to Docker
if: inputs.dry-run != 'true'
shell: bash
run: |
echo $DOCKER_TOKEN | docker login --username $DOCKER_USERNAME --password-stdin
- name: Run Goreleaser
id: goreleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean ${{ inputs.dry-run == 'true' && '--skip=publish' || '' }}

- name: Build release artifacts
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
LD_RELEASER_UPDATE_MAJOR: ${{ inputs.update-major-tag }}
LD_RELEASER_UPDATE_LATEST: ${{ inputs.update-latest-tag }}
- name: Generate binary hashes
run: |
TAG="${{ inputs.tag }}"
VERSION="${TAG#v}"
./scripts/release.sh ${{ inputs.dry-run == 'true' && '--dry-run' || '' }} "$VERSION"

- name: Output checksum file path
id: binary
shell: bash
env:
ARTIFACTS: ${{ steps.goreleaser.outputs.artifacts }}
run: |
# Extract path to checksums file generated by goreleaser
set -euo pipefail
echo "checksum_file=dist/checksums.txt" >> "$GITHUB_OUTPUT"

checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
echo "checksum_file=$checksum_file" >> "$GITHUB_OUTPUT"
- name: Output image and digest
id: image
shell: bash
env:
ARTIFACTS: "${{ steps.goreleaser.outputs.artifacts }}"
run: |
# Generate image digest
set -euo pipefail
echo "images_and_digests=$(echo "$ARTIFACTS" | jq -c '. | map(select (.type=="Docker Manifest") | .image=(.path | split(":")[0]) | .digest=(.extra | .Digest) | {image, digest})')" >> "$GITHUB_OUTPUT"
if [[ -f dist/images_and_digests.json ]]; then
echo "images_and_digests=$(cat dist/images_and_digests.json)" >> "$GITHUB_OUTPUT"
else
echo "images_and_digests=[]" >> "$GITHUB_OUTPUT"
fi

- name: Upload Release Artifacts
if: inputs.dry-run != 'true'
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
with:
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386
driver-opts: network=host
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Build Docker Images
run: make products-for-release
- name: Get current Relay version
Expand Down
Loading
Loading