From 3bd24c83db058c1e3be8cf0b6d1446c989db13d5 Mon Sep 17 00:00:00 2001 From: quietvoid <39477805+quietvoid@users.noreply.github.com> Date: Mon, 28 Feb 2022 00:07:27 -0500 Subject: [PATCH] Try building binaries --- .cargo/config.toml | 2 - .github/workflows/release.yml | 93 +++++++++++++++++++++++++++++++++++ Cargo.toml | 6 ++- README.md | 3 +- 4 files changed, 100 insertions(+), 4 deletions(-) delete mode 100644 .cargo/config.toml create mode 100644 .github/workflows/release.yml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 2010bd7..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[target.'cfg(any(windows, unix))'] -rustflags = ["-Ctarget-cpu=native"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c05b325 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/Cargo.toml b/Cargo.toml index bfa29ed..6f97cbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/README.md b/README.md index 245c30b..5a43500 100644 --- a/README.md +++ b/README.md @@ -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.