Auto release preview patch releases (#20886)

Conrad Irwin created

This should make the process of releasing patch releases to preview less
toilful

Release Notes:

- N/A

Change summary

.github/workflows/ci.yml | 13 +++++++++++++
1 file changed, 13 insertions(+)

Detailed changes

.github/workflows/ci.yml 🔗

@@ -404,3 +404,16 @@ jobs:
             target/release/zed-linux-aarch64.tar.gz
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+  auto-release-preview:
+    name: Auto release preview
+    if: ${{ startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre') && !endsWith(github.ref, '.0-pre') }}
+    needs: [bundle-mac, bundle-linux, bundle-linux-aarch64]
+    runs-on:
+      - self-hosted
+      - bundle
+    steps:
+      - name: gh release
+        run: gh release edit $GITHUB_REF_NAME --draft=false
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}