From 4db172ca4a788996f78b95e9326ed4df074a473e Mon Sep 17 00:00:00 2001 From: William Venner Date: Sun, 12 Dec 2021 17:27:07 +0000 Subject: [PATCH] Add CD --- .github/workflows/build.yml | 81 +++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 62 ---------------------------- 2 files changed, 81 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ae61ce5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,81 @@ +name: build + +on: + push: + tags: + - '*.*.*' + +env: + CARGO_TERM_COLOR: always + +jobs: + build_linux_cli: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Build + run: cargo build --verbose --release + + - name: Strip + run: strip target/release/blackhole + + - name: Rename + run: mv target/release/blackhole target/release/blackhole_linux64 + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: target/release/blackhole_linux64 + fail_on_unmatched_files: true + + build_windows_gui: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + + - name: Download WiX Toolset + run: curl -L -o "wix311.zip" https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip + + - name: Extract WiX Toolset + run: mkdir wix311 && cd wix311 && tar -xf ..\wix311.zip && cd ..\ + + - name: Install cargo wix + run: cargo install cargo-wix + + - name: Build + env: + RUSTFLAGS: -Ctarget-feature=+crt-static + run: cargo build --verbose --release --features gui + + - name: Create installer + run: cargo wix -v -b "wix311" --no-build --nocapture + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: target/wix/blackhole-*.*.*-x86_64.msi + fail_on_unmatched_files: true + + build_macos_gui: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + + - name: Install cargo bundle + run: cargo install cargo-bundle + + - name: Build + run: cargo bundle --features gui --release + + - name: Rename + run: mv target/release/bundle/osx/Blackhole.app target/release/bundle/osx/blackhole_macos64.app + + - name: ZIP + run: zip -r target/release/bundle/osx/blackhole_macos64.app.zip target/release/bundle/osx/blackhole_macos64.app + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: target/release/bundle/osx/blackhole_macos64.app.zip + fail_on_unmatched_files: true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 4048ebc..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: build - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build_linux_cli: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose - - build_linux_gui: - needs: build_linux_cli - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install GUI - run: sudo apt-get update && sudo apt-get install libgtk-3-dev -y - - name: Build - run: cargo build --verbose --features gui - - build_windows_cli: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Build - env: - RUSTFLAGS: -Ctarget-feature=+crt-static - run: cargo build --verbose - - build_windows_gui: - needs: build_windows_cli - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Build - env: - RUSTFLAGS: -Ctarget-feature=+crt-static - run: cargo build --verbose --features gui - - build_macos_cli: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose - - build_macos_gui: - needs: build_macos_cli - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose --features gui