Skip to content

Release Binaries and Docker Build #8

Release Binaries and Docker Build

Release Binaries and Docker Build #8

Workflow file for this run

name: Release Binaries and Docker Build
on:
release:
types: [released]
permissions:
contents: write
packages: write
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.0
# Build binaries for all architectures
- name: Build binaries
run: make build-all
# Server binary uploads
- name: Upload server binary (Linux, AMD64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./server/build/arkd-linux-amd64
asset_name: arkd-linux-amd64
asset_content_type: application/octet-stream
- name: Upload server binary (Linux, ARM)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./server/build/arkd-linux-arm64
asset_name: arkd-linux-arm64
asset_content_type: application/octet-stream
- name: Upload server binary (Darwin, AMD64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./server/build/arkd-darwin-amd64
asset_name: arkd-darwin-amd64
asset_content_type: application/octet-stream
- name: Upload server binary (Darwin, ARM)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./server/build/arkd-darwin-arm64
asset_name: arkd-darwin-arm64
asset_content_type: application/octet-stream
# CLI binary uploads
- name: Upload client binary (Linux, AMD64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./client/build/ark-linux-amd64
asset_name: ark-linux-amd64
asset_content_type: application/octet-stream
- name: Upload client binary (Linux, ARM)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./client/build/ark-linux-arm64
asset_name: ark-linux-arm64
asset_content_type: application/octet-stream
- name: Upload client binary (Darwin, AMD64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./client/build/ark-darwin-amd64
asset_name: ark-darwin-amd64
asset_content_type: application/octet-stream
- name: Upload client binary (Darwin, ARM)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./client/build/ark-darwin-arm64
asset_name: ark-darwin-arm64
asset_content_type: application/octet-stream
# WASM SDK upload
- name: Upload WASM SDK
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: pkg/client-sdk/build/ark-sdk.wasm
asset_name: ark-sdk.wasm
asset_content_type: application/wasm
docker-build-and-push:
runs-on: ubuntu-latest
needs: build-and-upload
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }},ghcr.io/${{ github.repository }}:latest
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ github.event.release.tag_name }}