From 620c44eae49d5e6cebb56bb35c1fe5cfab0f9a48 Mon Sep 17 00:00:00 2001 From: yellowsink Date: Sat, 14 Sep 2024 17:02:32 +0100 Subject: [PATCH] add workflow --- .github/workflows/release.yml | 110 ++++++++++++++++++++++++++++++++++ imhex_fldf.hexproj | Bin 21504 -> 0 bytes 2 files changed, 110 insertions(+) create mode 100644 .github/workflows/release.yml delete mode 100644 imhex_fldf.hexproj diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..af5fcdc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,110 @@ +name: Build and release +on: [ push, workflow_dispatch ] + +permissions: + contents: write + +env: + CARGO_TERM_COLOR: always + FORCE_COLOR: true + +jobs: + build: + name: Build for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + binsuffix: linux + file: target/release/foldiff + strip: true + - os: windows-latest + binsuffix: windows + file: target/release/foldiff.exe + strip: true + - os: macos-latest + binsuffix: macos + file: target/release/foldiff + strip: true + + steps: + - uses: actions/checkout@v3 + + - name: Install Rust toolchain + id: install_rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt, clippy + + - name: Install Linux specific packages + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install build-essential clang-format libgtk-3-dev + + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: | + v2-${{ github.workflow }}-${{ runner.os }}-rust-${{ steps.install_rust.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + v2-${{ github.workflow }}-${{ runner.os }}-rust-${{ steps.install_rust.outputs.rustc_hash }}- + v2-${{ github.workflow }}-${{ runner.os }}-rust- + + - name: cargo build + run: cargo build --verbose --release + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: foliff-${{ matrix.binsuffix }} + path: ${{ matrix.file }} + + release: + name: Create release + runs-on: ubuntu-latest + needs: [ build ] + if: startsWith(github.ref, 'refs/tags/') + + steps: + - uses: actions/checkout@v3 + + - uses: actions/download-artifact@v4 + with: + name: foldiff-linux + path: linux + + - uses: actions/download-artifact@v4 + with: + name: foldiff-macos + path: macos + + - uses: actions/download-artifact@v4 + with: + name: foldiff-windows + path: windows + + - name: Get some values needed for the release + id: release_values + run: | + echo "::set-output name=date::$(date '+%Y-%m-%d')" + echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" + + - name: Rename files + run: | + mv linux/foldiff linux/foldiff.Linux + mv macos/foldiff macos/foldiff.MacOS + + - name: Create release + uses: softprops/action-gh-release@v1 + with: + name: Foldiff ${{ steps.release_values.outputs.tag }}, ${{ steps.release_values.outputs.date }} + files: | + linux/foldiff.Linux + macos/foldiff.MacOS + windows/foldiff.exe diff --git a/imhex_fldf.hexproj b/imhex_fldf.hexproj deleted file mode 100644 index 5ed342152a41a0b21da95c093eb6120886b71447..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21504 zcmeHPZBN@s5aw(0E3Dk<3Q`;F*fA*_r-O#5{Xm6uR6PlyXmK{ghhs;6;Yd&X_nX=E zt~a43DYa2(H)_F|oqcxpnc3MFub9Qrtv{l1vQ^(_Z?DV1&7~&P?+eeSZJF+t!D}s5 z(qAiOU?%*(YnknTk|?YcorAfq!yZ&0qrkRZt^hyPGShS%r?X|KGO4H^DrMlmrU9Q; zLeta_uanlk!6i(3MG|^68pSlh0`oP~WhGt~$7kf4E{R8eG7HH3Bbj1JD<$obKOVP~ ziZhZ!usE|Y`y-k(IpaE`hPbIgUGv~qsr6&R$2bHJJO7$^?%oO9G(9QcItb| z^FQ$>KE0(=8m73^ztAbaKFT)=*?NXW*0<+>%eE|?|DPjJEOQsOB<8jH4IG?N?`t1WfhsCVU`&9Wfqg`DKSWvPNLZOOykc{aN88( z5ly_+4*#b}lcW!o5LZa2gBHe;l&ZvcLav!5Ql}wZ!Mcrmzdfp=gE;wH+}2iefTjJcDV{ zu!q`~E7UD_9euka^zF_%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