diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8051238e..15f3fd9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,21 +102,22 @@ jobs: run: | (Get-FileHash "${{env.RELEASE_DIR}}.zip" -Algorithm SHA256).hash | Out-File -FilePath "${{env.RELEASE_DIR}}.zip.sha256" type "${{env.RELEASE_DIR}}.zip.sha256" - - - name: Create nightly github release + + - name: Delete old nightly if: github.ref_name == 'master' - run: | - gh release delete nightly --yes --cleanup-tag - gh release create nightly --prerelease --title "Nightly" --notes "Generated release from GitHub Actions" - echo "Ignore 'Validation Failed' results. Expected since only the first job that reaches this step can create the release." - exit 0 + uses: dev-drprasad/delete-tag-and-release@v0.2.1 + with: + delete_release: true + tag_name: nightly env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload artifacts to github release - if: github.ref_name == 'master' - run: | - gh release upload nightly "${{env.RELEASE_DIR}}.zip" --clobber - gh release upload nightly "${{env.RELEASE_DIR}}.zip.sha256" --clobber - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Create new nightly + uses: ncipollo/release-action@v1 + with: + name: Nightly + generateReleaseNotes: true + prerelease: true + artifacts: "${{env.RELEASE_DIR}}.zip,{{env.RELEASE_DIR}}.zip.sha256" + tag: nightly + token: ${{ secrets.GITHUB_TOKEN }}