Skip to content

Added delete (message/all) api endpoints #24

Added delete (message/all) api endpoints

Added delete (message/all) api endpoints #24

Workflow file for this run

name: Release
on:
push:
tags:
- v*.*.*
jobs:
prepare:
name: Prepare release
runs-on: ubuntu-20.04
steps:
- name: Release
uses: softprops/action-gh-release@v1
with:
body: |
Docker releases: https://hub.docker.com/repository/docker/marlonb/mailcrab/tags
Run docker image using: `docker run --rm -p 1080:1080 -p 1025:1025 marlonb/mailcrab:${{ github.ref_name }}`
draft: true
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
frontend:
name: Build frontend assets
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- run: rustup target add wasm32-unknown-unknown
- uses: jetli/trunk-action@v0.4.0
with:
version: 'v0.16.0'
- uses: actions/cache/restore@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
frontend/target/
key: frontend-${{ hashFiles('frontend/Cargo.toml') }}
restore-keys: frontend-
- name: Build frontend
run: trunk build
working-directory: frontend
- uses: actions/upload-artifact@v4
with:
name: frontend-build-${{ github.ref_name }}
path: frontend/dist
build:
name: Binaries for ${{ matrix.name }}
needs: frontend
runs-on: ${{ matrix.os }}
strategy:
matrix:
name:
- linux-x86-64-gnu
- linux-armv7-gnu
- linux-arm64-gnu
- linux-x86-64-musl
- linux-arm64-musl
include:
- name: linux-x86-64-gnu
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
platform: ~
cross: false
- name: linux-armv7-gnu
os: ubuntu-20.04
target: armv7-unknown-linux-gnueabihf
platform: ~
cross: true
- name: linux-arm64-gnu
os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
platform: ~
cross: true
- name: linux-x86-64-musl
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
platform: amd64
cross: true
- name: linux-arm64-musl
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
platform: arm64
cross: true
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- uses: actions/download-artifact@v4
with:
name: frontend-build-${{ github.ref_name }}
path: frontend/dist
- uses: actions/cache/restore@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
backend/target/
key: backend-${{ matrix.name }}-${{ hashFiles('backend/Cargo.toml') }}
restore-keys: backend-${{ matrix.name }}-
- run: cargo install cross --git https://github.com/cross-rs/cross || true
- name: Build
if: ${{ !matrix.cross }}
run: cargo build --release --locked --target ${{ matrix.target }} --manifest-path backend/Cargo.toml
- name: Cross build
if: ${{ matrix.cross }}
run: cross build --release --locked --target ${{ matrix.target }} --manifest-path backend/Cargo.toml
- name: Copy binaries
if: ${{ matrix.platform == null }}
shell: bash
run: |
mkdir -p bin
src="backend/target/${{ matrix.target }}/release/mailcrab-backend"
dst="bin/mailcrab-${{ matrix.name }}-${{ github.ref_name }}"
cp "$src" "$dst"
sha256sum -b "$dst" > "$dst.sha256"
- uses: softprops/action-gh-release@v1
if: ${{ matrix.platform == null }}
with:
draft: true
files: bin/mailcrab-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Copy binary
if: ${{ matrix.platform != null }}
run: mkdir -p bin && cp backend/target/${{ matrix.target }}/release/mailcrab-backend bin/${{ matrix.platform }}
- uses: actions/upload-artifact@v4
if: ${{ matrix.platform != null }}
with:
name: ${{ matrix.platform }}-build-${{ github.ref_name }}
path: bin/${{ matrix.platform }}
release:
name: Release
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup docker buildx
uses: docker/setup-buildx-action@v2
- name: Login to dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: amd64-build-${{ github.ref_name }}
path: bin
- uses: actions/download-artifact@v4
with:
name: arm64-build-${{ github.ref_name }}
path: bin
- name: Build docker image
run: docker buildx build --push --platform=linux/amd64,linux/arm64 . -t marlonb/mailcrab:latest -t marlonb/mailcrab:${{ github.ref_name }}