49 lines
1.7 KiB
YAML
49 lines
1.7 KiB
YAML
# Push a version tag (git tag v1.2.0 && git push origin v1.2.0) and every build lands on that
|
|
# tag's release: macOS (the app), Ubuntu (with a window), Linux without a screen, and the server.
|
|
#
|
|
# Runners (see deploy/ci/README.md):
|
|
# anybot-linux a Linux computer with Docker; jobs run in anybot-builder:22.04
|
|
# macos-arm64 a Mac (runs directly on it)
|
|
name: Release
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
env:
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
|
|
|
|
jobs:
|
|
linux:
|
|
runs-on: anybot-linux
|
|
env:
|
|
# Kept between releases (a Docker volume on the runner): only what changed is compiled.
|
|
CARGO_TARGET_DIR: /ci-target
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build
|
|
run: |
|
|
cargo build --release --bin anybot
|
|
cd relay && cargo build --release
|
|
- name: Test
|
|
# A failing test stops the release (piped straight into `tail`, it never did).
|
|
run: |
|
|
cargo test --release --bin anybot -- --skip live > "${RUNNER_TEMP:-/tmp}/test.log" 2>&1 || { tail -n 80 "${RUNNER_TEMP:-/tmp}/test.log"; exit 1; }
|
|
tail -n 3 "${RUNNER_TEMP:-/tmp}/test.log"
|
|
- name: Package
|
|
run: sh deploy/ci/package-linux.sh "${GITHUB_REF_NAME#v}"
|
|
- name: Upload
|
|
run: sh deploy/ci/upload-release.sh "$GITHUB_REF_NAME" dist/*.tar.gz
|
|
|
|
macos:
|
|
runs-on: macos-arm64
|
|
env:
|
|
CARGO_TARGET_DIR: ${{ github.workspace }}/../anybot-target
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build
|
|
run: cargo build --release --bin anybot
|
|
- name: Package
|
|
run: sh deploy/mac/bundle.sh "${GITHUB_REF_NAME#v}"
|
|
- name: Upload
|
|
run: sh deploy/ci/upload-release.sh "$GITHUB_REF_NAME" dist/*.zip
|