merge main #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker Images and Binaries | ||
# reusable workflow, do not add triggers | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
jobs: | ||
build-linux-images: | ||
name: Build ${{ matrix.os }}/${{ matrix.arch }} | ||
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || format('burnt-labs-{0}', matrix.arch) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- linux | ||
arch: | ||
- amd64 | ||
- arm64 | ||
permissions: | ||
id-token: write | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
<<<<<<< HEAD | ||
path: dist | ||
pattern: xiond-* | ||
merge-multiple: true | ||
======= | ||
go-version: ${{ env.GO_VERSION }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser | ||
version: "~> v2" | ||
args: build --clean --skip validate --id xiond_${{ matrix.os }}_${{ matrix.arch }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
>>>>>>> main | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up docker buildx for push | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver: docker | ||
platforms: ${{ matrix.os }}/${{ matrix.arch }} | ||
- name: Prepare environment | ||
run: | | ||
echo "DOCKER_FN=docker-${{ matrix.os }}-${{ matrix.arch }}.tar" | tee -a $GITHUB_ENV | ||
echo "HEIGHLINER_FN=heighliner-${{ matrix.os }}-${{ matrix.arch }}.tar" | tee -a $GITHUB_ENV | ||
- name: Build Docker Image | ||
id: build-docker | ||
uses: docker/build-push-action@v5 | ||
with: | ||
target: release | ||
push: false | ||
load: true | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ matrix.os }}/${{ matrix.arch }} | ||
tags: xion:${{ matrix.os }}-${{ matrix.arch }} | ||
build-args: | | ||
XIOND_BINARY=dist/xiond-${{ matrix.os }}-${{ matrix.arch }} | ||
- name: Build Heighliner Image | ||
id: build-heighliner | ||
uses: docker/build-push-action@v5 | ||
with: | ||
target: heighliner | ||
push: false | ||
load: true | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ matrix.os }}/${{ matrix.arch }} | ||
tags: heighliner:${{ matrix.os }}-${{ matrix.arch }} | ||
build-args: | | ||
XIOND_BINARY=dist/xiond-${{ matrix.os }}-${{ matrix.arch }} | ||
- name: Save Docker Image | ||
working-directory: ${{ runner.temp }} | ||
run: | | ||
docker save xion:${{ matrix.os }}-${{ matrix.arch }} > ${{ env.DOCKER_FN }} | ||
- name: Upload Docker Image | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.DOCKER_FN }} | ||
path: ${{ runner.temp }}/${{ env.DOCKER_FN }} | ||
if-no-files-found: error | ||
retention-days: 3 | ||
- name: Save Heighliner Image | ||
working-directory: ${{ runner.temp }} | ||
run: | | ||
docker save heighliner:${{ matrix.os }}-${{ matrix.arch }} > ${{ env.HEIGHLINER_FN }} | ||
- name: Upload Heighliner Image | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.HEIGHLINER_FN }} | ||
path: ${{ runner.temp }}/${{ env.HEIGHLINER_FN }} | ||
if-no-files-found: error | ||
retention-days: 3 |