From 57013ddb6a957e77db528cdfbc13b149f969db90 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Sat, 14 Oct 2023 18:24:39 +0200 Subject: [PATCH] Update to not require node 12 --- .github/workflows/build-dll.yml | 49 ++++++++++++--------------------- .github/workflows/rust.yml | 7 ++--- 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build-dll.yml b/.github/workflows/build-dll.yml index 815066d..ec47f8a 100644 --- a/.github/workflows/build-dll.yml +++ b/.github/workflows/build-dll.yml @@ -26,46 +26,31 @@ jobs: profile: ["dev","release"] feature: ["alloc std"] #"alloc" target: [i686-pc-windows-msvc, i686-pc-windows-gnu ,x86_64-pc-windows-msvc, x86_64-pc-windows-gnu] + include: + - profile: "dev" + flag: "debug" + - profile: "release" + flag: "release" steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - name: setup rust + uses: moonrepo/setup-rust@v1 with: - toolchain: stable - target: ${{ matrix.target }} - - uses: actions-rs/cargo@v1 - with: - command: install - args: cbindgen - - uses: actions-rs/cargo@v1 - with: - command: build - args: --target ${{ matrix.target }} --profile ${{ matrix.profile }} --no-default-features --features '${{ matrix.feature }}' --package dll-inject + cache-target: ${{ matrix.flag }} + targets: ${{ matrix.target }} + components: cbindgen + - name: build + run: cargo build --target ${{ matrix.target }} --profile ${{ matrix.profile }} --no-default-features --features '${{ matrix.feature }}' --package dll-inject - name: generate bindings working-directory: ./dll-inject run: cbindgen --config cbindgen.toml --crate dll-inject --output dll-inject.h - - name: list dependencies - uses: actions-rs/cargo@v1 - with: - command: rustc - args: -p dll-inject --features '${{ matrix.feature }}' -- --print native-static-libs - - - uses: actions/upload-artifact@v3 - name: upload release artifact - if: ${{ matrix.profile == 'release' }} - with: - name: dll-inject-${{ matrix.target}}-release-${{ matrix.feature }} - path: | - dll-inject/dll-inject.h - target/${{ matrix.target }}/release/libdll_inject.* - target/${{ matrix.target }}/release/dll_inject.* - + run: cargo rustc -p dll-inject --features '${{ matrix.feature }}' -- --print native-static-libs - uses: actions/upload-artifact@v3 - name: upload dev artifact - if: ${{ matrix.profile == 'dev' }} + name: upload artifact with: - name: dll-inject-${{ matrix.target}}-dev-${{ matrix.feature }} + name: dll-inject-${{ matrix.target}}-${{ matrix.profile }}-${{ matrix.feature }} path: | dll-inject/dll-inject.h - target/${{ matrix.target }}/debug/dll_inject.* - target/${{ matrix.target }}/debug/libdll_inject.* + target/${{ matrix.target }}/${{ matrix.flag }}/libdll_inject.* + target/${{ matrix.target }}/${{ matrix.flag }}/dll_inject.* diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ac99e66..2da3f69 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,12 +30,11 @@ jobs: target: [i686-pc-windows-msvc,x86_64-pc-windows-msvc] steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: moonrepo/setup-rust@v1 with: profile: minimal - toolchain: ${{ matrix.toolchain }} - override: true - target: ${{ matrix.target }} + channel: ${{ matrix.toolchain }} + targets: ${{ matrix.target }} - uses: actions-rs/cargo@v1 with: command: build