Binary build #88
Workflow file for this run
This file contains hidden or 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
--- | |
#------------------------------------------------------------------------------- | |
# Workflow configuration | |
#------------------------------------------------------------------------------- | |
name: "Binary build" | |
on: | |
release: | |
types: [published] | |
push: | |
paths: | |
- ".github/workflows/build.yaml" | |
- "Cargo.toml" | |
- "crates/**" | |
- "macos/**" | |
- "windows/**" | |
- "deployments/**" | |
- "freedesktop/**" | |
pull_request_review: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
#------------------------------------------------------------------------------- | |
# Workflow jobs | |
#------------------------------------------------------------------------------- | |
jobs: | |
build-linux: | |
name: "Build on Linux" | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checkout repository (and submodules) | |
- name: Checkout repository (and submodules) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
# Get current git tag version | |
- name: Get git version | |
id: git_tag_version | |
run: | | |
export BUILD_VERSION=$(git describe --tags --abbrev=0) | |
echo "Build at version $BUILD_VERSION" | |
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_OUTPUT | |
# Install dependencies (from package manager) | |
- name: Install dependencies (from package manager) | |
run: | | |
sudo apt-get install libgl1-mesa-dev libxcb1-dev libxkbcommon-x11-dev libx11-xcb-dev libxcb-cursor0 libzstd-dev fuse libfuse-dev libwayland-dev -y; | |
sudo apt-get install cmake ninja-build pkgconf libtool fish -y; | |
sudo apt-get install musl-tools musl-dev -y; | |
sudo apt-get install appstream -y; | |
# Build application | |
- name: Build application | |
run: | | |
rustup update stable && rustup default stable; | |
cargo build --release --bins; | |
- name: Build cli for musl | |
run: | | |
rustup target add x86_64-unknown-linux-musl; | |
cargo build --release -p wsrx --target x86_64-unknown-linux-musl; | |
# Deploy Glibc application | |
- name: Compress Glibc Binaries | |
run: tar --transform='s!.*/!!' -czvf wsrx-cli-linux-gnu-x86_64.tar.gz target/release/wsrx | |
# Deploy musl application | |
- name: Compress musl Binaries | |
run: tar --transform='s!.*/!!' -czvf wsrx-cli-linux-musl-x86_64.tar.gz target/x86_64-unknown-linux-musl/release/wsrx | |
# Build AppImage | |
- name: Build AppImage | |
run: | | |
./deployments/appimage.fish | |
# Move files | |
- name: move files | |
run: | | |
mv wsrx-cli-linux-gnu-x86_64.tar.gz wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.tar.gz | |
mv wsrx-cli-linux-musl-x86_64.tar.gz wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-musl-x86_64.tar.gz | |
mv WebSocketReflectorX-x86_64.AppImage WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.AppImage | |
# Upload Glibc cli package | |
- name: Upload Glibc cli package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.tar.gz | |
path: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.tar.gz | |
# Upload musl cli package | |
- name: Upload musl cli package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-musl-x86_64.tar.gz | |
path: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-musl-x86_64.tar.gz | |
# Upload AppImage | |
- name: Upload AppImage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.AppImage | |
path: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.AppImage | |
# Upload to github release | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-musl-x86_64.tar.gz | |
wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.tar.gz | |
WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-linux-gnu-x86_64.AppImage | |
build-windows: | |
name: "Build on Windows" | |
runs-on: windows-2022 | |
steps: | |
# Checkout repository (and submodules) | |
- name: Checkout repository (and submodules) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
# Get current git tag version | |
- name: Get git version | |
id: git_tag_version | |
run: | | |
echo BUILD_VERSION=$(git describe --tags --abbrev=0) | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
- name: Install NASM for aws-lc-rs on Windows | |
uses: ilammy/setup-nasm@v1 | |
- name: Install ninja-build tool for aws-lc-fips-sys on Windows | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
# Build application | |
- name: Build application | |
run: | | |
rustup update stable && rustup default stable; | |
cargo build --release --bins; | |
# Compress cli binaries | |
- name: Compress CLI Binaries | |
run: 7z a wsrx-cli-windows-msvc-x86_64.zip target/release/wsrx.exe | |
# Deploy application | |
- name: Deploy application | |
run: sh deployments/nsis.sh | |
# Move files | |
- name: move files | |
run: | | |
mv wsrx-cli-windows-msvc-x86_64.zip wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-windows-msvc-x86_64.zip | |
mv WebSocketReflectorX-installer-windows-msvc-x86_64.exe WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-installer-windows-msvc-x86_64.exe | |
mv WebSocketReflectorX-portable-windows-msvc-x86_64.zip WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-portable-windows-msvc-x86_64.zip | |
# Upload application ZIP | |
- name: Upload application ZIP | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-windows-msvc-x86_64.zip | |
path: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-windows-msvc-x86_64.zip | |
# Upload NSIS installer | |
- name: Upload NSIS installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-installer-windows-msvc-x86_64.exe | |
path: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-installer-windows-msvc-x86_64.exe | |
# Upload portable package | |
- name: Upload Portable package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-portable-windows-msvc-x86_64.zip | |
path: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-portable-windows-msvc-x86_64.zip | |
# Upload to github release | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-windows-msvc-x86_64.zip | |
WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-installer-windows-msvc-x86_64.exe | |
WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-portable-windows-msvc-x86_64.zip | |
build-mac: | |
name: "Build on MacOS" | |
runs-on: macos-latest | |
steps: | |
# Checkout repository (and submodules) | |
- name: Checkout repository (and submodules) | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
# Get current git tag version | |
- name: Get git version | |
id: git_tag_version | |
run: | | |
export BUILD_VERSION=$(git describe --tags --abbrev=0) | |
echo "Build at version $BUILD_VERSION" | |
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_OUTPUT | |
# Build CLI binaries | |
- name: Build CLI binaries | |
run: | | |
rustup update stable && rustup default stable; | |
cargo install cargo-bundle; | |
cargo build --release --bins; | |
# Build CLI binaries for x86_64 | |
- name: Build CLI binaries for x86_64 | |
run: | | |
rustup target add x86_64-apple-darwin; | |
cargo build --release --bins --target x86_64-apple-darwin; | |
# Compress aarch64 binaries | |
- name: Compress Binaries for aarch64 | |
run: zip -r -y -X wsrx-cli-macos-aarch64.zip target/release/wsrx | |
# Compress x86_64 binaries | |
- name: Compress Binaries for x86_64 | |
run: zip -r -y -X wsrx-cli-macos-x86_64.zip target/x86_64-apple-darwin/release/wsrx | |
# Build OSX DMG app | |
- name: Build DMG | |
run: | | |
sh deployments/macos.sh | |
# Move files | |
- name: move files | |
run: | | |
mv WebSocketReflectorX.dmg WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.dmg | |
mv WebSocketReflectorX.app.zip WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.app.zip | |
mv wsrx-cli-macos-aarch64.zip wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.zip | |
mv wsrx-cli-macos-x86_64.zip wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-x86_64.zip | |
# Upload cli ZIP for aarch64 | |
- name: Upload cli ZIP for aarch64 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.zip | |
path: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.zip | |
# Upload cli ZIP for aarch64 | |
- name: Upload cli ZIP for x86_64 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-x86_64.zip | |
path: wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-x86_64.zip | |
# Upload application ZIP for aarch64 | |
- name: Upload application ZIP for x86_64 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.app.zip | |
path: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.app.zip | |
# Upload application DMG for aarch64 | |
- name: Upload application DMG for x86_64 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.dmg | |
path: WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.dmg | |
# Upload to github release | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.zip | |
wsrx-cli-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-x86_64.zip | |
WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.app.zip | |
WebSocketReflectorX-${{steps.git_tag_version.outputs.BUILD_VERSION}}-macos-aarch64.dmg |