From 0a986827726991c4e6721754bc3b193922be68bd Mon Sep 17 00:00:00 2001 From: Tim Harding Date: Thu, 21 Mar 2024 22:45:52 -0700 Subject: [PATCH] Upload artifacts at end again --- .github/workflows/ci.yml | 105 ++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bb6fe3..37c0c30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,29 +9,9 @@ permissions: contents: write jobs: - create-release: - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Create release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ github.ref_name }} - run: | - gh release create "$TAG" \ - --verify-tag \ - --title="${TAG}" \ - --notes-from-tag - build-linux: runs-on: ubuntu-latest timeout-minutes: 10 - needs: - - create-release steps: - name: Checkout repository @@ -45,21 +25,16 @@ jobs: - name: Build run: cargo build --profile ci - - name: Rename artifact - run: mv target/ci/neophyte neophyte-linux - - - name: Upload to release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ github.ref_name }} - run: | - gh release upload "$TAG" neophyte-linux + - name: Archive artifact + uses: actions/upload-artifact@v4 + with: + name: neophyte-linux + path: target/ci/neophyte + retention-days: 1 build-macos: runs-on: macos-latest timeout-minutes: 10 - needs: - - create-release steps: - name: Checkout repository @@ -73,22 +48,16 @@ jobs: - name: Build run: cargo build --profile ci - - name: Rename artifact - run: mv target/ci/neophyte neophyte-macos - - - name: Upload to release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ github.ref_name }} - run: | - gh release upload "$TAG" neophyte-macos - + - name: Archive artifact + uses: actions/upload-artifact@v4 + with: + name: neophyte-macos + path: target/ci/neophyte + retention-days: 1 build-windows: runs-on: windows-latest timeout-minutes: 10 - needs: - - create-release steps: - name: Checkout repository @@ -102,12 +71,46 @@ jobs: - name: Build run: cargo build --profile ci - - name: Rename artifact - run: mv target/ci/neophyte.exe neophyte-windows.exe + - name: Archive artifact + uses: actions/upload-artifact@v4 + with: + name: neophyte-windows.exe + path: target/ci/neophyte.exe + retention-days: 1 + + create-release: + runs-on: ubuntu-latest + timeout-minutes: 10 + needs: + - build-linux + - build-macos + - build-windows + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 - - name: Upload to release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ github.ref_name }} - run: | - gh release upload "$TAG" neophyte-windows.exe + - name: Rename Linux artifact + run: mv neophyte-linux/neophyte neophyte-linux/neophyte-linux + + - name: Rename MacOS artifact + run: mv neophyte-macos/neophyte neophyte-macos/neophyte-macos + + - name: Rename Windows artifact + run: mv neophyte-windows/neophyte.exe neophyte-windows/neophyte-windows.exe + + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ github.ref_name }} + run: | + gh release create "$TAG" \ + neophyte-linux/neophyte-linux \ + neophyte-macos/neophyte-macos \ + neophyte-windows/neophyte-windows.exe \ + --verify-tag \ + --title="${TAG}" \ + --notes-from-tag