Bury failed nightly releases as prereleases (#31348)

This commit is contained in:
Delan Azabani 2024-02-14 16:05:09 +08:00 committed by GitHub
parent a4db81cbd0
commit d00312eb08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,21 +41,32 @@ jobs:
publish-nightly-release:
# This job is only useful when run on upstream servo.
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
if: always() && (github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch')
name: Publish GH Release for nightly
runs-on: ubuntu-20.04
steps:
- run: |
- name: Publish as latest (success)
if: success()
run: |
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${NIGHTLY_REPO}/releases/${RELEASE_ID} \
-F draft=false
env:
GITHUB_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
RELEASE_ID: ${{ needs.create-draft-release.outputs.release-id }}
- name: Publish as latest (failure)
if: failure()
run: |
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${NIGHTLY_REPO}/releases/${RELEASE_ID} \
-F prerelease=true -F draft=false
env:
GITHUB_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
RELEASE_ID: ${{ needs.create-draft-release.outputs.release-id }}
needs:
- create-draft-release
- upload-linux