From 16e4ae6332598e778685dacd324f68c8dd756e6a Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Sat, 28 Oct 2023 19:38:13 +0200 Subject: [PATCH] feat: basic ci --- .github/workflows/build.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..fe6d24b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: build and release + +on: + workflow_dispatch: + release: + types: [ created ] + +permissions: + contents: write + +jobs: + build: + name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }} + runs-on: ${{ matrix.platform.os }} + strategy: + fail-fast: false + matrix: + platform: + - os_name: Linux-aarch64 + os: ubuntu-20.04 + target: aarch64-unknown-linux-musl + bin: winapps-linux-arm64 + - os_name: Linux-x86_64 + os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + bin: winapps-linux-amd64 + toolchain: + - stable + steps: + - uses: actions/checkout@v4 + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 + with: + command: "build" + target: ${{ matrix.platform.target }} + toolchain: ${{ matrix.toolchain }} + args: "--release" + strip: true + - name: Rename binary (linux and macos) + run: mv target/${{ matrix.platform.target }}/release/winapps target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} + - name: Generate SHA-256 + run: shasum -a 256 target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | cut -d ' ' -f 1 > target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256 + - name: Release binary and SHA-256 checksum to GitHub + uses: softprops/action-gh-release@v1 + with: + files: | + target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} + target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256