83 lines
2.1 KiB
YAML
83 lines
2.1 KiB
YAML
# Builds the client and server for every platform and packs everything needed to
|
|
# run them into an archive: a zip on Windows and a tar.gz elsewhere.
|
|
name: Package
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
jobs:
|
|
package:
|
|
name: Package ${{ matrix.target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- { os: windows-latest, target: x86_64-pc-windows-msvc }
|
|
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
|
|
- { os: macos-latest, target: aarch64-apple-darwin }
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Linux dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
pkg-config libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Cache cargo
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ${{ matrix.target }}
|
|
|
|
- name: Pack client and server
|
|
run: cargo xtask pack --target ${{ matrix.target }}
|
|
|
|
- name: Upload archive
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: station-${{ matrix.target }}
|
|
path: |
|
|
dist/station-*.zip
|
|
dist/station-*.tar.gz
|
|
if-no-files-found: error
|
|
# The archive is already compressed.
|
|
compression-level: 0
|
|
|
|
release:
|
|
name: Publish release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
needs: package
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: dist
|
|
merge-multiple: true
|
|
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
dist/station-*.zip
|
|
dist/station-*.tar.gz
|