mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-26 15:44:20 +00:00
GitHub allows defining a default shell for all jobs on the workflow level, which we did not use before, yet practically did when it comes down to our usage of `named::bash`. Since this makes stuff quite verbose, I decided on using the defaults instead so the workflows become somewhat easier to audit when reading the generated files. Powershell steps continue to use Powershell, only the default for bash scripts was modified. Release Notes: - N/A
141 lines
5.3 KiB
YAML
141 lines
5.3 KiB
YAML
# Generated from xtask::workflows::after_release
|
|
# Rebuild with `cargo xtask workflows`.
|
|
name: after_release
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag_name:
|
|
description: tag_name
|
|
required: true
|
|
type: string
|
|
prerelease:
|
|
description: prerelease
|
|
required: true
|
|
type: boolean
|
|
body:
|
|
description: body
|
|
type: string
|
|
default: ''
|
|
jobs:
|
|
rebuild_releases_page:
|
|
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
|
runs-on: namespace-profile-2x4-ubuntu-2404
|
|
steps:
|
|
- name: after_release::rebuild_releases_page::refresh_cloud_releases
|
|
run: curl -fX POST https://cloud.zed.dev/releases/refresh?expect_tag=${{ github.event.release.tag_name || inputs.tag_name }}
|
|
- name: steps::checkout_repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
with:
|
|
clean: false
|
|
- name: after_release::rebuild_releases_page::redeploy_zed_dev
|
|
run: ./script/redeploy-vercel
|
|
env:
|
|
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
|
post_to_discord:
|
|
needs:
|
|
- rebuild_releases_page
|
|
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
|
runs-on: namespace-profile-2x4-ubuntu-2404
|
|
steps:
|
|
- id: get-release-url
|
|
name: after_release::post_to_discord::get_release_url
|
|
run: |
|
|
if [ "${{ github.event.release.prerelease || inputs.prerelease }}" == "true" ]; then
|
|
URL="https://zed.dev/releases/preview"
|
|
else
|
|
URL="https://zed.dev/releases/stable"
|
|
fi
|
|
|
|
echo "URL=$URL" >> "$GITHUB_OUTPUT"
|
|
- id: get-content
|
|
name: after_release::post_to_discord::get_content
|
|
uses: 2428392/gh-truncate-string-action@b3ff790d21cf42af3ca7579146eedb93c8fb0757
|
|
with:
|
|
stringToTruncate: |
|
|
📣 Zed [${{ github.event.release.tag_name || inputs.tag_name }}](<${{ steps.get-release-url.outputs.URL }}>) was just released!
|
|
|
|
${{ github.event.release.body || inputs.body }}
|
|
maxLength: 2000
|
|
truncationSymbol: '...'
|
|
- name: after_release::post_to_discord::discord_webhook_action
|
|
uses: tsickert/discord-webhook@c840d45a03a323fbc3f7507ac7769dbd91bfb164
|
|
with:
|
|
webhook-url: ${{ secrets.DISCORD_WEBHOOK_RELEASE_NOTES }}
|
|
content: ${{ steps.get-content.outputs.string }}
|
|
publish_winget:
|
|
runs-on: self-32vcpu-windows-2022
|
|
steps:
|
|
- name: after_release::publish_winget::sync_winget_pkgs_fork
|
|
run: |
|
|
$headers = @{
|
|
"Authorization" = "Bearer $env:WINGET_TOKEN"
|
|
"Accept" = "application/vnd.github+json"
|
|
"X-GitHub-Api-Version" = "2022-11-28"
|
|
}
|
|
$body = @{ branch = "master" } | ConvertTo-Json
|
|
$uri = "https://api.github.com/repos/${{ github.repository_owner }}/winget-pkgs/merge-upstream"
|
|
try {
|
|
Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Body $body -ContentType "application/json"
|
|
Write-Host "Successfully synced winget-pkgs fork"
|
|
} catch {
|
|
Write-Host "Fork sync response: $_"
|
|
Write-Host "Continuing anyway - fork may already be up to date"
|
|
}
|
|
shell: pwsh
|
|
env:
|
|
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
|
- id: set-package-name
|
|
name: after_release::publish_winget::set_package_name
|
|
run: |
|
|
if ("${{ github.event.release.prerelease || inputs.prerelease }}" -eq "true") {
|
|
$PACKAGE_NAME = "ZedIndustries.Zed.Preview"
|
|
} else {
|
|
$PACKAGE_NAME = "ZedIndustries.Zed"
|
|
}
|
|
|
|
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $env:GITHUB_OUTPUT
|
|
shell: pwsh
|
|
- name: after_release::publish_winget::winget_releaser
|
|
uses: vedantmgoyal9/winget-releaser@19e706d4c9121098010096f9c495a70a7518b30f
|
|
with:
|
|
identifier: ${{ steps.set-package-name.outputs.PACKAGE_NAME }}
|
|
release-tag: ${{ github.event.release.tag_name || inputs.tag_name }}
|
|
max-versions-to-keep: 5
|
|
token: ${{ secrets.WINGET_TOKEN }}
|
|
create_sentry_release:
|
|
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
|
runs-on: namespace-profile-2x4-ubuntu-2404
|
|
steps:
|
|
- name: steps::checkout_repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
with:
|
|
clean: false
|
|
- name: release::create_sentry_release
|
|
uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c
|
|
with:
|
|
environment: production
|
|
env:
|
|
SENTRY_ORG: zed-dev
|
|
SENTRY_PROJECT: zed
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
notify_on_failure:
|
|
needs:
|
|
- rebuild_releases_page
|
|
- post_to_discord
|
|
- publish_winget
|
|
- create_sentry_release
|
|
if: failure()
|
|
runs-on: namespace-profile-2x4-ubuntu-2404
|
|
steps:
|
|
- name: release::send_slack_message
|
|
run: |
|
|
curl -X POST -H 'Content-type: application/json'\
|
|
--data '{"text":"❌ ${{ github.workflow }} failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' "$SLACK_WEBHOOK"
|
|
env:
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}
|
|
defaults:
|
|
run:
|
|
shell: bash -euxo pipefail {0}
|