From 3f86dcc3a5a03c1b27c2b798cb5f7afb0783de5d Mon Sep 17 00:00:00 2001 From: "Michael L. Young" Date: Sat, 11 Jun 2022 21:51:19 -0400 Subject: [PATCH] Adjust release build artifacts upload to handle pre-releases Update the upload-artifacts and download-artifacts version Signed-off-by: Michael L. Young --- .github/workflows/releasebuild.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/releasebuild.yml b/.github/workflows/releasebuild.yml index a8387602..dba75820 100644 --- a/.github/workflows/releasebuild.yml +++ b/.github/workflows/releasebuild.yml @@ -7,7 +7,6 @@ on: - published jobs: - distbuild: name: Checkout code and build tar.gz runs-on: ubuntu-latest @@ -35,13 +34,13 @@ jobs: run: make dist - name: Upload mock script - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: mockbuild.sh path: ci/mockbuild.sh - name: Upload tar.gz - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: warewulf-${{ env.VERSION }}.tar.gz path: warewulf-${{ env.VERSION }}.tar.gz @@ -60,12 +59,12 @@ jobs: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - name: Download mock build script - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: mockbuild.sh - name: Download tar.gz - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: warewulf-${{ env.VERSION }}.tar.gz @@ -76,19 +75,20 @@ jobs: run: ./mockbuild.sh ${{ env.VERSION }} - name: Upload EL8 RPM - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: warewulf-${{ env.VERSION }}-${{ env.RELEASE }}.el8.x86_64.rpm path: warewulf-${{ env.VERSION }}-${{ env.RELEASE }}.el8.x86_64.rpm - name: Upload EL7 RPM - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: warewulf-${{ env.VERSION }}-${{ env.RELEASE }}.el7.x86_64.rpm path: warewulf-${{ env.VERSION }}-${{ env.RELEASE }}.el7.x86_64.rpm - name: Upload Assets To Release - uses: xresloader/upload-to-github-release@master + if: "!github.event.release.prerelease" + uses: xresloader/upload-to-github-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -96,3 +96,16 @@ jobs: draft: false update_latest_release: true tags: true + + - name: Upload Assets To Pre-Release + if: "github.event.release.prerelease" + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: 'warewulf-${{ env.VERSION }}.tar.gz;warewulf-${{ env.VERSION }}-${{ env.RELEASE }}.*.rpm' + draft: false + update_latest_release: false + prerelease: true + tags: true + \ No newline at end of file