build: add a release workflow for mmclient #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- 'mmclient-v*.*.*' | |
name: Release mmclient | |
jobs: | |
create_tarball_linux: | |
name: Build mmclient (linux) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-unknown-linux-gnu | |
- name: install deps | |
run: sudo apt install \ | |
nasm cmake protobuf-compiler libxkbcommon-dev libwayland-dev \ | |
ffmpeg libavutil-dev libavformat-dev libavdevice-dev libavfilter-dev | |
- uses: actions/checkout@v4 | |
- uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
mm-client | |
mm-protocol | |
- name: cargo build | |
run: (cd mm-client && cargo build --bin mmclient --release --target x86_64-unknown-linux-gnu) | |
- name: create release tarball | |
run: |- | |
mkdir "${RUNNER_TEMP}/${GITHUB_REF_NAME}" | |
cp -r mm-client/target/x86_64-unknown-linux-gnu/release/mmclient README.md \ | |
"${RUNNER_TEMP}/${GITHUB_REF_NAME}" | |
cp LICENSES/MIT.txt "${RUNNER_TEMP}/${GITHUB_REF_NAME}/LICENSE.txt" | |
tar -C "${RUNNER_TEMP}" --numeric-owner -cvzf "${GITHUB_REF_NAME}-linux-amd64.tar.gz" "$GITHUB_REF_NAME" | |
- name: upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
path: mmclient-*.tar.gz | |
create_tarball_macos: | |
name: Build mmclient (macos) | |
runs-on: macos-latest | |
steps: | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: aarch64-apple-darwin | |
- name: install deps | |
run: brew install ffmpeg@6 | |
- uses: actions/checkout@v4 | |
- uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
mm-client | |
mm-protocol | |
- name: cargo build | |
run: (cd mm-client && cargo build --bin mmclient --release --features moltenvk_static --target aarch64-apple-darwin) | |
- name: create release tarball | |
run: |- | |
mkdir "${RUNNER_TEMP}/${GITHUB_REF_NAME}" | |
cp -r mm-client/target/aarch64-apple-darwin/release/mmclient README.md \ | |
"${RUNNER_TEMP}/${GITHUB_REF_NAME}" | |
cp LICENSES/MIT.txt "${RUNNER_TEMP}/${GITHUB_REF_NAME}/LICENSE.txt" | |
tar -C "${RUNNER_TEMP}" --numeric-owner -cvzf "${GITHUB_REF_NAME}-darwin-arm64.tar.gz" "$GITHUB_REF_NAME" | |
- name: upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
path: mmclient-*.tar.gz | |
create_release: | |
name: Create release | |
needs: [create_tarball_linux, create_tarball_macos] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: install git-cliff | |
run: cargo install git-cliff | |
- name: generate release notes | |
run: |- | |
echo "# Client version ${GITHUB_REF_NAME/mmclient-v/}" >> release-notes.txt | |
git cliff -c .github/workflows/cliff.toml --include-path "mm-client/**/*" | tail -n +2 >> release-notes.txt | |
- name: download artifacts | |
uses: actions/download-artifact@v4 | |
- name: create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: release-notes.txt | |
files: "mmclient-*.tar.gz" | |