1# Generated from xtask::workflows::after_release
2# Rebuild with `cargo xtask workflows`.
3name: after_release
4on:
5 release:
6 types:
7 - published
8 workflow_dispatch:
9 inputs:
10 tag_name:
11 description: tag_name
12 required: true
13 type: string
14 prerelease:
15 description: prerelease
16 required: true
17 type: boolean
18 body:
19 description: body
20 type: string
21 default: ''
22jobs:
23 rebuild_releases_page:
24 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
25 runs-on: namespace-profile-2x4-ubuntu-2404
26 steps:
27 - name: after_release::rebuild_releases_page::refresh_cloud_releases
28 run: curl -fX POST https://cloud.zed.dev/releases/refresh?expect_tag=${{ github.event.release.tag_name || inputs.tag_name }}
29 shell: bash -euxo pipefail {0}
30 - name: steps::checkout_repo
31 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
32 with:
33 clean: false
34 - name: after_release::rebuild_releases_page::redeploy_zed_dev
35 run: ./script/redeploy-vercel
36 shell: bash -euxo pipefail {0}
37 env:
38 VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
39 post_to_discord:
40 needs:
41 - rebuild_releases_page
42 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
43 runs-on: namespace-profile-2x4-ubuntu-2404
44 steps:
45 - id: get-release-url
46 name: after_release::post_to_discord::get_release_url
47 run: |
48 if [ "${{ github.event.release.prerelease || inputs.prerelease }}" == "true" ]; then
49 URL="https://zed.dev/releases/preview"
50 else
51 URL="https://zed.dev/releases/stable"
52 fi
53
54 echo "URL=$URL" >> "$GITHUB_OUTPUT"
55 shell: bash -euxo pipefail {0}
56 - id: get-content
57 name: after_release::post_to_discord::get_content
58 uses: 2428392/gh-truncate-string-action@b3ff790d21cf42af3ca7579146eedb93c8fb0757
59 with:
60 stringToTruncate: |
61 📣 Zed [${{ github.event.release.tag_name || inputs.tag_name }}](<${{ steps.get-release-url.outputs.URL }}>) was just released!
62
63 ${{ github.event.release.body || inputs.body }}
64 maxLength: 2000
65 truncationSymbol: '...'
66 - name: after_release::post_to_discord::discord_webhook_action
67 uses: tsickert/discord-webhook@c840d45a03a323fbc3f7507ac7769dbd91bfb164
68 with:
69 webhook-url: ${{ secrets.DISCORD_WEBHOOK_RELEASE_NOTES }}
70 content: ${{ steps.get-content.outputs.string }}
71 publish_winget:
72 runs-on: self-32vcpu-windows-2022
73 steps:
74 - name: after_release::publish_winget::sync_winget_pkgs_fork
75 run: |
76 $headers = @{
77 "Authorization" = "Bearer $env:WINGET_TOKEN"
78 "Accept" = "application/vnd.github+json"
79 "X-GitHub-Api-Version" = "2022-11-28"
80 }
81 $body = @{ branch = "master" } | ConvertTo-Json
82 $uri = "https://api.github.com/repos/${{ github.repository_owner }}/winget-pkgs/merge-upstream"
83 try {
84 Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Body $body -ContentType "application/json"
85 Write-Host "Successfully synced winget-pkgs fork"
86 } catch {
87 Write-Host "Fork sync response: $_"
88 Write-Host "Continuing anyway - fork may already be up to date"
89 }
90 shell: pwsh
91 env:
92 WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
93 - id: set-package-name
94 name: after_release::publish_winget::set_package_name
95 run: |
96 if ("${{ github.event.release.prerelease || inputs.prerelease }}" -eq "true") {
97 $PACKAGE_NAME = "ZedIndustries.Zed.Preview"
98 } else {
99 $PACKAGE_NAME = "ZedIndustries.Zed"
100 }
101
102 echo "PACKAGE_NAME=$PACKAGE_NAME" >> $env:GITHUB_OUTPUT
103 shell: pwsh
104 - name: after_release::publish_winget::winget_releaser
105 uses: vedantmgoyal9/winget-releaser@19e706d4c9121098010096f9c495a70a7518b30f
106 with:
107 identifier: ${{ steps.set-package-name.outputs.PACKAGE_NAME }}
108 release-tag: ${{ github.event.release.tag_name || inputs.tag_name }}
109 max-versions-to-keep: 5
110 token: ${{ secrets.WINGET_TOKEN }}
111 create_sentry_release:
112 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
113 runs-on: namespace-profile-2x4-ubuntu-2404
114 steps:
115 - name: steps::checkout_repo
116 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
117 with:
118 clean: false
119 - name: release::create_sentry_release
120 uses: getsentry/action-release@526942b68292201ac6bbb99b9a0747d4abee354c
121 with:
122 environment: production
123 env:
124 SENTRY_ORG: zed-dev
125 SENTRY_PROJECT: zed
126 SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
127 notify_on_failure:
128 needs:
129 - rebuild_releases_page
130 - post_to_discord
131 - publish_winget
132 - create_sentry_release
133 if: failure()
134 runs-on: namespace-profile-2x4-ubuntu-2404
135 steps:
136 - name: release::notify_on_failure::notify_slack
137 run: |-
138 curl -X POST -H 'Content-type: application/json'\
139 --data '{"text":"${{ github.workflow }} failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' "$SLACK_WEBHOOK"
140 shell: bash -euxo pipefail {0}
141 env:
142 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_WORKFLOW_FAILURES }}