From 92453ff9c2f0770a2d34cc6a15da8c85cb9a0775 Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Mon, 19 Sep 2022 15:05:39 +0200 Subject: [PATCH] Improve GitHub workflow --- .github/workflows/release.yaml | 90 ++++++++++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 903d523..c2cd44f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,8 +6,8 @@ on: - "main" jobs: - pre-release: - name: "Pre-release" + compile: + name: "Compilation" strategy: matrix: os: [windows-2022, ubuntu-22.04, macos-12] @@ -27,15 +27,85 @@ jobs: run: | cargo build --release --no-default-features --features=${{ matrix.features }} - - name: Upload binary - if: ${{ matrix.os }}=="windows" + - name: Upload full binary uses: actions/upload-artifact@v3 + if: ${{ matrix.features == 'debug,render' }} with: - name: worlds-rs.exe - path: target/release/worlds-sim-rust.exe - - name: Uplaod binary - if: ${{ matrix.os }}!="windows" + name: worlds-rs-${{ matrix.os }}-debug-render + path: target/release/worlds-sim-rust* + + - name: Upload partial-feature binary uses: actions/upload-artifact@v3 + if: ${{ matrix.features != 'debug,render' && matrix.features != '' }} with: - name: world-rs - path: target/release/worlds-sim-rust + name: worlds-rs-${{ matrix.os }}-${{ matrix.features }} + path: target/release/worlds-sim-rust* + + - name: Upload basic binary + uses: actions/upload-artifact@v3 + if: ${{ matrix.features == '' }} + with: + name: worlds-rs-${{ matrix.os }}-none + path: target/release/worlds-sim-rust* + + create-release: + name: "Create release" + runs-on: ubuntu-22.04 + needs: [compile] + steps: + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-windows-2022-full + path: ~/download/worlds-rs-windows-2022-full.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-windows-2022-debug + path: ~/download/worlds-rs-windows-2022-debug.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-windows-2022-render + path: ~/download/worlds-rs-windows-2022-render.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-windows-2022-none + path: ~/download/worlds-rs-windows-2022-none.zip + + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-ubuntu-22.04-full + path: ~/download/worlds-rs-ubuntu-22.04-full.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-ubuntu-22.04-debug + path: ~/download/worlds-rs-ubuntu-22.04-debug.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-ubuntu-22.04-render + path: ~/download/worlds-rs-ubuntu-22.04-render.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-ubuntu-22.04-none + path: ~/download/worlds-rs-ubuntu-22.04-none.zip + + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-macos-12-full + path: ~/download/worlds-rs-macos-12-full.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-macos-12-debug + path: ~/download/worlds-rs-macos-12-debug.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-macos-12-render + path: ~/download/worlds-rs-macos-12-render.zip + - uses: actions/download-artifact@v3 + with: + name: worlds-rs-macos-12-none + path: ~/download/worlds-rs-macos-12-none.zip + + - name: Upload binaries + uses: softprops/action-gh-release@v1 + with: + files: + ~/download/* \ No newline at end of file