mirror of
https://github.com/Empostor/Empostor.git
synced 2026-10-19 15:51:39 +00:00
88 lines
2.2 KiB
YAML
88 lines
2.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup .NET 8
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 8.0.x
|
|
|
|
- name: Install Cake.Tool
|
|
run: dotnet tool install --global Cake.Tool
|
|
|
|
- name: Run Cake Build
|
|
run: dotnet cake build.cake --target=Build
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-output
|
|
path: build/
|
|
|
|
- name: Create Release (tag only)
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: build/*
|
|
generate_release_notes: true
|
|
|
|
docker:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name != 'pull_request'
|
|
|
|
strategy:
|
|
matrix:
|
|
arch:
|
|
- { docker: linux/amd64, rid: amd64 }
|
|
- { docker: linux/arm64, rid: arm64 }
|
|
- { docker: linux/arm/v7, rid: arm }
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Build Docker image (${{ matrix.arch.rid }})
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: ${{ matrix.arch.docker }}
|
|
load: true
|
|
tags: empostor-server:${{ matrix.arch.rid }}
|
|
build-args: |
|
|
VERSIONSUFFIX=docker
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
provenance: false
|
|
|
|
- name: Export Docker image to tar
|
|
run: docker save empostor-server:${{ matrix.arch.rid }} -o empostor-server-docker-${{ matrix.arch.rid }}.tar
|
|
|
|
- name: Upload Docker image
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: empostor-docker-${{ matrix.arch.rid }}
|
|
path: empostor-server-docker-${{ matrix.arch.rid }}.tar
|