Skip to content

Commit

Permalink
Try building binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
quietvoid committed Feb 28, 2022
1 parent 8ccb7ce commit 3bd24c8
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

93 changes: 93 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
on:
workflow_dispatch:

name: Artifacts

env:
RELEASE_BIN: vspreview-rs
RELEASE_DIR: artifacts
WINDOWS_TARGET: x86_64-pc-windows-msvc
MACOS_TARGET: x86_64-apple-darwin
LINUX_TARGET: x86_64-unknown-linux-musl

jobs:
build:
name: Build artifacts
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
rust: stable
- build: macos
os: macos-latest
rust: stable
- build: windows
os: windows-latest
rust: stable

steps:
- uses: actions/checkout@v2

- name: Install Rust
if: matrix.rust
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
- name: Install musl-tools (Linux)
if: matrix.build == 'linux'
run: |
sudo apt-get update -y
sudo apt-get install musl-tools libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev -y
- name: Install p7zip (MacOS)
if: matrix.build == 'macos'
run: brew install p7zip

- name: Build (Linux)
if: matrix.build == 'linux'
run: |
rustup target add ${{ env.LINUX_TARGET }}
cargo build --release --target ${{ env.LINUX_TARGET }}
- name: Build (MacOS)
if: matrix.build == 'macos'
run: cargo build --release

- name: Build (Windows)
if: matrix.build == 'windows'
run: cargo build --release

- name: Create artifact directory
run: |
mkdir ${{ env.RELEASE_DIR }}
- name: Create tarball (Linux)
if: matrix.build == 'linux'
run: |
strip ./target/${{ env.LINUX_TARGET }}/release/${{ env.RELEASE_BIN }}
mv ./target/${{ env.LINUX_TARGET }}/release/${{ env.RELEASE_BIN }} ./${{ env.RELEASE_BIN }}
7z a -ttar -so -an ./ | 7z a -si ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ env.LINUX_TARGET }}.tar.gz
- name: Create tarball (Windows)
if: matrix.build == 'windows'
shell: bash
run: |
mv ./target/release/${{ env.RELEASE_BIN }}.exe ./${{ env.RELEASE_BIN }}.exe
7z a -ttar -so -an ./ | 7z a -si ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ env.WINDOWS_TARGET }}.tar.gz
- name: Create tarball (MacOS)
if: matrix.build == 'macos'
run: |
strip ./target/release/${{ env.RELEASE_BIN }}
mv ./target/release/${{ env.RELEASE_BIN }} ./${{ env.RELEASE_BIN }}
7z a -ttar -so -an ./ | 7z a -si ./${{ env.RELEASE_DIR }}/${{ env.RELEASE_BIN }}-${{ env.MACOS_TARGET }}.tar.gz
- name: Upload Zip
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.build }}
path: ./${{ env.RELEASE_DIR }}
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ serde = "1.0.133"
num_enum = "0.5.6"
parking_lot = "0.12.0"

[[bin]]
name = "vspreview-rs"
path = "src/main.rs"

[profile.release]
debug = true
opt-level = 3
strip = true
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Built on top of [egui](https://github.com/emilk/egui) and [vapoursynth-rs](https
 

### Dependencies
See [eframe](https://github.com/emilk/egui/tree/master/eframe) dependencies.
Requires a VapourSynth installation with support for API 3.6 minimum.
For the GUI, see [eframe](https://github.com/emilk/egui/tree/master/eframe) dependencies.

### Building
The minimum Rust version to build `vspreview-rs` is 1.59.0.
Expand Down

0 comments on commit 3bd24c8

Please sign in to comment.