This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
refactor: migrate to monolithic daemon (#2) #25
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 | |
on: | |
push: | |
branches: | |
- "main" | |
# - "images-ci" | |
jobs: | |
build: | |
continue-on-error: true | |
strategy: | |
matrix: | |
include: | |
- release_for: Linux-GNU-x86_64 | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
arch: amd64 | |
args: "--locked --release" | |
- release_for: Linux-GNU-armv7 | |
os: ubuntu-latest | |
target: "armv7-unknown-linux-gnueabihf" | |
arch: arm64 | |
args: "--locked --release --features vendored-openssl" | |
# - release_for: Windows-x86_64 | |
# os: windows-latest | |
# target: x86_64-pc-windows-msvc | |
# bin: controller.exe | |
# name: precious-Windows-x86_64.zip | |
# command: both | |
# - release_for: macOS-x86_64 | |
# os: macOS-latest | |
# target: x86_64-apple-darwin | |
# bin: controller | |
# name: precious-Darwin-x86_64.tar.gz | |
# command: both | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build binary | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: both | |
target: ${{ matrix.target }} | |
args: ${{ matrix.args }} | |
strip: true | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dmtrop-${{ matrix.arch }} | |
path: target/${{ matrix.target }}/release/dmtrop | |
docker: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/demeter-run/operator | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=semver,pattern=v{{major}} | |
type=semver,pattern=v{{major}}.{{minor}} | |
type=semver,pattern=v{{version}} | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io/demeter-run | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: .github/Dockerfile | |
platforms: linux/arm64,linux/amd64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |