150 lines
5.1 KiB
YAML
150 lines
5.1 KiB
YAML
name: Release binaries for all platforms
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
release-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: install Tauri
|
|
run: cargo install tauri-cli --profile dev
|
|
- name: npm install (desktop)
|
|
working-directory: desktop
|
|
run: npm install
|
|
- name: npm install (librqbit/webui)
|
|
working-directory: crates/librqbit/webui
|
|
run: npm install
|
|
|
|
- name: cargo tauri build
|
|
working-directory: desktop
|
|
run: cargo tauri build --ci
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
desktop/src-tauri/target/release/bundle/msi/rqbit-desktop_*_x64_en-US.msi
|
|
|
|
- name: Build release
|
|
run: cargo build --profile release-github
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
target/release-github/rqbit.exe
|
|
|
|
cross-compile-on-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: install Tauri
|
|
run: cargo install tauri-cli --profile dev
|
|
- name: npm install (desktop)
|
|
working-directory: desktop
|
|
run: npm install
|
|
- name: npm install (librqbit/webui)
|
|
working-directory: crates/librqbit/webui
|
|
run: npm install
|
|
|
|
- name: cargo tauri build
|
|
working-directory: desktop
|
|
run:
|
|
rustup target add aarch64-apple-darwin && rustup target add x86_64-apple-darwin &&
|
|
cargo tauri build --target universal-apple-darwin --ci
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
desktop/src-tauri/target/universal-apple-darwin/release/bundle/dmg/rqbit-desktop_*_universal.dmg
|
|
|
|
- name: Make a directory for output artifacts
|
|
run: mkdir -p target/artifacts
|
|
|
|
- name: Build release OSX universal binary
|
|
run: rustup target install aarch64-apple-darwin &&
|
|
cargo build --profile release-github --target x86_64-apple-darwin &&
|
|
cargo build --profile release-github --target aarch64-apple-darwin &&
|
|
lipo ./target/x86_64-apple-darwin/release-github/rqbit ./target/aarch64-apple-darwin/release-github/rqbit -create -output ./target/artifacts/rqbit-osx-universal
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
target/artifacts/rqbit-osx-universal
|
|
|
|
- name: install linux cross compiler toolchains
|
|
run: brew tap messense/macos-cross-toolchains &&
|
|
brew install x86_64-unknown-linux-musl aarch64-unknown-linux-musl armv7-unknown-linux-musleabihf
|
|
|
|
- name: Build release linux x86_64 binary
|
|
run: rustup target install x86_64-unknown-linux-musl &&
|
|
make release-linux-x86_64 &&
|
|
cp -l target/x86_64-unknown-linux-musl/release-github/rqbit target/artifacts/rqbit-linux-static-x86_64-musl
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
target/artifacts/rqbit-linux-static-x86_64-musl
|
|
|
|
- name: Build release linux armv7 binary
|
|
run: rustup target install armv7-unknown-linux-musleabihf &&
|
|
make release-linux-armv7-musl &&
|
|
cp -l target/armv7-unknown-linux-musleabihf/release-github/rqbit target/artifacts/rqbit-linux-static-armv7-musl
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
target/artifacts/rqbit-linux-static-armv7-musl
|
|
|
|
- name: Build release linux aarch64 binary
|
|
run: rustup target install aarch64-unknown-linux-musl &&
|
|
make release-linux-aarch64 &&
|
|
cp -l target/aarch64-unknown-linux-musl/release-github/rqbit target/artifacts/rqbit-linux-static-aarch64-musl
|
|
- uses: softprops/action-gh-release@v1
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
target/artifacts/rqbit-linux-static-aarch64-musl
|
|
|
|
- name: Create target/docker
|
|
run: make create-target-docker
|
|
|
|
- name: Archive target/docker/
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: target-docker
|
|
path: target/docker/
|
|
|
|
build-push-docker:
|
|
runs-on: ubuntu-latest
|
|
needs: cross-compile-on-macos
|
|
steps:
|
|
- name: Download a single artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: target-docker
|
|
path: target/docker
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
tags: ikatson/rqbit:${{ github.ref_name }}
|
|
context: target/docker/
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
file: target/docker/Dockerfile
|