Skip to content
Merged
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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ jobs:
name: ember-server
path: target/release/ember-server

helm:
name: helm lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: azure/setup-helm@v4
- name: lint
run: helm lint helm/ember
- name: template
run: helm template ember helm/ember

docker:
name: docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build
run: docker build -t ember:ci .

security:
name: security
runs-on: ubuntu-latest
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: release

on:
push:
tags: ["v*"]

permissions:
contents: write
packages: write

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact: ember-server-linux-amd64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
artifact: ember-server-linux-arm64
- target: x86_64-apple-darwin
os: macos-latest
artifact: ember-server-darwin-amd64
- target: aarch64-apple-darwin
os: macos-latest
artifact: ember-server-darwin-arm64
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}

- name: build
run: cargo build --release --target ${{ matrix.target }}

- name: package
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/ember-server dist/${{ matrix.artifact }}

- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dist/${{ matrix.artifact }}

docker:
name: docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: extract version
id: version
run: echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: set up docker buildx
uses: docker/setup-buildx-action@v3

- name: login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.tag }}
ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

release:
name: github release
runs-on: ubuntu-latest
needs: [build, docker]
steps:
- uses: actions/checkout@v4

- name: download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: collect binaries
run: |
mkdir -p release
find artifacts -type f -name 'ember-server-*' -exec cp {} release/ \;
cd release && sha256sum * > checksums.txt

- name: create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: release/*
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM rust:1.93-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
libssl-dev \
make \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/ember
Expand Down