1# Generated from xtask::workflows::publish_extension_cli
2# Rebuild with `cargo xtask workflows`.
3name: publish_extension_cli
4env:
5 CARGO_TERM_COLOR: always
6 CARGO_INCREMENTAL: '0'
7on:
8 push:
9 tags:
10 - extension-cli
11jobs:
12 publish_job:
13 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
14 runs-on: namespace-profile-16x32-ubuntu-2204
15 steps:
16 - name: steps::checkout_repo
17 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
18 with:
19 clean: false
20 - name: steps::cache_rust_dependencies_namespace
21 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
22 with:
23 cache: rust
24 path: ~/.rustup
25 - name: steps::setup_linux
26 run: ./script/linux
27 - name: publish_extension_cli::publish_job::build_extension_cli
28 run: cargo build --release --package extension_cli
29 - name: publish_extension_cli::publish_job::upload_binary
30 run: script/upload-extension-cli "$GITHUB_SHA"
31 env:
32 DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
33 DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }}
34 update_sha_in_zed:
35 needs:
36 - publish_job
37 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
38 runs-on: namespace-profile-8x16-ubuntu-2204
39 steps:
40 - id: generate-token
41 name: steps::generate_token
42 uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
43 with:
44 app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
45 private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
46 - name: steps::checkout_repo
47 uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
48 with:
49 clean: false
50 - name: steps::cache_rust_dependencies_namespace
51 uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
52 with:
53 cache: rust
54 path: ~/.rustup
55 - id: short-sha
56 name: publish_extension_cli::get_short_sha
57 run: |
58 echo "sha_short=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_OUTPUT"
59 - name: publish_extension_cli::update_sha_in_zed::replace_sha
60 run: |
61 sed -i "s/ZED_EXTENSION_CLI_SHA: &str = \"[a-f0-9]*\"/ZED_EXTENSION_CLI_SHA: \&str = \"$GITHUB_SHA\"/" \
62 tooling/xtask/src/tasks/workflows/extension_tests.rs
63 - name: publish_extension_cli::update_sha_in_zed::regenerate_workflows
64 run: cargo xtask workflows
65 - name: steps::create_pull_request
66 uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
67 with:
68 title: 'extension_ci: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`'
69 body: |
70 This PR bumps the extension CLI version used in the extension workflows to `${{ github.sha }}`.
71
72 Release Notes:
73
74 - N/A
75 commit-message: 'extension_ci: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`'
76 branch: update-extension-cli-sha
77 committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
78 author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
79 base: main
80 delete-branch: true
81 token: ${{ steps.generate-token.outputs.token }}
82 sign-commits: true
83 assignees: ${{ github.actor }}
84 update_sha_in_extensions:
85 needs:
86 - publish_job
87 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
88 runs-on: namespace-profile-2x4-ubuntu-2404
89 steps:
90 - id: generate-token
91 name: steps::generate_token
92 uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
93 with:
94 app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
95 private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
96 owner: zed-industries
97 repositories: extensions
98 - id: short-sha
99 name: publish_extension_cli::get_short_sha
100 run: |
101 echo "sha_short=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_OUTPUT"
102 - name: publish_extension_cli::update_sha_in_extensions::checkout_extensions_repo
103 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
104 with:
105 repository: zed-industries/extensions
106 token: ${{ steps.generate-token.outputs.token }}
107 - name: publish_extension_cli::update_sha_in_extensions::replace_sha
108 run: |
109 sed -i "s/ZED_EXTENSION_CLI_SHA: [a-f0-9]*/ZED_EXTENSION_CLI_SHA: $GITHUB_SHA/" \
110 .github/workflows/ci.yml
111 - name: steps::create_pull_request
112 uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
113 with:
114 title: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`
115 body: |
116 This PR bumps the extension CLI version to https://github.com/zed-industries/zed/commit/${{ github.sha }}.
117 commit-message: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`
118 branch: update-extension-cli-sha
119 committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
120 author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
121 base: main
122 delete-branch: true
123 token: ${{ steps.generate-token.outputs.token }}
124 sign-commits: true
125 assignees: ${{ github.actor }}
126 labels: allow-no-extension
127defaults:
128 run:
129 shell: bash -euxo pipefail {0}