mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
200 lines
6.1 KiB
YAML
200 lines
6.1 KiB
YAML
# Manually triggered action to build deltachat-rpc-server binaries.
|
|
|
|
name: Build deltachat-rpc-server binaries
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
# Build a version statically linked against musl libc
|
|
# to avoid problems with glibc version incompatibility.
|
|
build_static_linux:
|
|
name: Build deltachat-rpc-server for Linux
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup rust target
|
|
run: rustup target add x86_64-unknown-linux-musl
|
|
|
|
- name: Install musl-gcc
|
|
run: sudo apt install musl-tools
|
|
|
|
- name: Build
|
|
env:
|
|
RUSTFLAGS: "-C link-arg=-s"
|
|
run: cargo build --release --target x86_64-unknown-linux-musl -p deltachat-rpc-server --features vendored
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-x86_64
|
|
path: target/x86_64-unknown-linux-musl/release/deltachat-rpc-server
|
|
if-no-files-found: error
|
|
|
|
build_linux:
|
|
name: Cross-compile deltachat-rpc-server for aarch64 and armv7 Linux
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Build
|
|
run: sh scripts/zig-rpc-server.sh
|
|
|
|
- name: Upload aarch64 binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-aarch64
|
|
path: target/aarch64-unknown-linux-musl/release/deltachat-rpc-server
|
|
if-no-files-found: error
|
|
|
|
- name: Upload armv7 binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-armv7
|
|
path: target/armv7-unknown-linux-musleabihf/release/deltachat-rpc-server
|
|
if-no-files-found: error
|
|
|
|
build_android:
|
|
name: Cross-compile deltachat-rpc-server for Android (armeabi-v7a, arm64-v8a, x86 and x86_64)
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: nttld/setup-ndk@v1
|
|
id: setup-ndk
|
|
with:
|
|
ndk-version: r21d
|
|
|
|
- name: Build
|
|
env:
|
|
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
run: sh scripts/android-rpc-server.sh
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-android-armv7
|
|
path: target/armv7-linux-androideabi/release/deltachat-rpc-server
|
|
if-no-files-found: error
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-android-aarch64
|
|
path: target/aarch64-linux-android/release/deltachat-rpc-server
|
|
if-no-files-found: error
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-android-i686
|
|
path: target/i686-linux-android/release/deltachat-rpc-server
|
|
if-no-files-found: error
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-android-x86_64
|
|
path: target/x86_64-linux-android/release/deltachat-rpc-server
|
|
if-no-files-found: error
|
|
|
|
build_windows:
|
|
name: Build deltachat-rpc-server for Windows
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: windows-latest
|
|
artifact: win32.exe
|
|
path: deltachat-rpc-server.exe
|
|
target: i686-pc-windows-msvc
|
|
|
|
- os: windows-latest
|
|
artifact: win64.exe
|
|
path: deltachat-rpc-server.exe
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup rust target
|
|
run: rustup target add ${{ matrix.target }}
|
|
|
|
- name: Build
|
|
run: cargo build --release --package deltachat-rpc-server --target ${{ matrix.target }} --features vendored
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: deltachat-rpc-server-${{ matrix.artifact }}
|
|
path: target/${{ matrix.target}}/release/${{ matrix.path }}
|
|
if-no-files-found: error
|
|
|
|
publish:
|
|
name: Upload binaries to the release
|
|
needs:
|
|
["build_static_linux", "build_linux", "build_android", "build_windows"]
|
|
permissions:
|
|
contents: write
|
|
runs-on: "ubuntu-latest"
|
|
steps:
|
|
- name: Download deltachat-rpc-server-x86_64
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-x86_64"
|
|
|
|
- name: Download deltachat-rpc-server-aarch64
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-aarch64"
|
|
|
|
- name: Download deltachat-rpc-server-armv7
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-armv7"
|
|
|
|
- name: Download deltachat-rpc-server-android-armv7
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-android-armv7"
|
|
|
|
- name: Download deltachat-rpc-server-android-aarch64
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-android-aarch64"
|
|
|
|
- name: Download deltachat-rpc-server-android-i686
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-android-i686"
|
|
|
|
- name: Download deltachat-rpc-server-android-x86_64
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-android-x86_64"
|
|
|
|
- name: Download deltachat-rpc-server-win32.exe
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-win32.exe"
|
|
|
|
- name: Download deltachat-rpc-server-win64.exe
|
|
uses: "actions/download-artifact@v3"
|
|
with:
|
|
name: "deltachat-rpc-server-win64.exe"
|
|
|
|
- name: Upload binaries to the GitHub release
|
|
env:
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
run: |
|
|
gh release upload ${{ github.ref_name }} \
|
|
--repo ${{ github.repository }} \
|
|
deltachat-rpc-server-*
|