diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ad162c0e --- /dev/null +++ b/.github/workflows/release.yml @@ -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