ci: add automated multiplatform release workflow
This commit is contained in:
parent
56b2d23c2b
commit
e371653e2c
1 changed files with 91 additions and 0 deletions
91
.github/workflows/release.yml
vendored
Normal file
91
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
name: Release Multiplatform Binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Linux x86_64 (.AppImage, .deb)
|
||||
- os: ubuntu-22.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
name: linux-x86_64
|
||||
|
||||
# Windows x86_64 (.exe installer)
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
name: windows-x86_64
|
||||
|
||||
# macOS Apple Silicon (.dmg)
|
||||
- os: macos-14
|
||||
target: aarch64-apple-darwin
|
||||
name: macos-arm64
|
||||
|
||||
# macOS Intel (.dmg)
|
||||
- os: macos-13
|
||||
target: x86_64-apple-darwin
|
||||
name: macos-x86_64
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Install Linux build dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev libfontconfig1-dev libfreetype6-dev libgl1-mesa-dev libvulkan-dev libasound2-dev
|
||||
|
||||
- name: Install cargo-packager
|
||||
run: cargo install cargo-packager --locked || true
|
||||
|
||||
- name: Build Release Binary
|
||||
run: cargo build --release --bin oneclient_app --target ${{ matrix.target }}
|
||||
|
||||
- name: Package Application
|
||||
run: cargo packager --release --target ${{ matrix.target }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Upload Build Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: binaries-${{ matrix.name }}
|
||||
path: |
|
||||
target/${{ matrix.target }}/release/oneclient_app*
|
||||
target/${{ matrix.target }}/release/bundle/**/*
|
||||
target/release/oneclient_app*
|
||||
dist/**/*
|
||||
|
||||
create-release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./artifacts
|
||||
|
||||
- name: Publish GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ./artifacts/**/*
|
||||
draft: false
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
Loading…
Add table
Reference in a new issue