Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T01:48:19.954Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

extension_bump.yml

329 lines · 12.5 KB · yaml
1# Generated from xtask::workflows::extension_bump
2# Rebuild with `cargo xtask workflows`.
3name: extension_bump
4env:
5  CARGO_TERM_COLOR: always
6  RUST_BACKTRACE: '1'
7  CARGO_INCREMENTAL: '0'
8  ZED_EXTENSION_CLI_SHA: 9ee3c503a4bbbc6b4a0f8a789acca4871d773223
9on:
10  workflow_call:
11    inputs:
12      bump-type:
13        description: bump-type
14        type: string
15        default: patch
16      force-bump:
17        description: force-bump
18        required: true
19        type: boolean
20      working-directory:
21        description: working-directory
22        type: string
23        default: .
24    secrets:
25      app-id:
26        description: The app ID used to create the PR
27        required: true
28      app-secret:
29        description: The app secret for the corresponding app ID
30        required: true
31permissions:
32  contents: read
33jobs:
34  check_version_changed:
35    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
36    runs-on: namespace-profile-2x4-ubuntu-2404
37    steps:
38    - name: steps::checkout_repo
39      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
40      with:
41        clean: false
42        fetch-depth: 0
43    - id: compare-versions-check
44      name: extension_bump::compare_versions
45      run: |
46        CURRENT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
47
48        if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
49            PR_FORK_POINT="$(git merge-base origin/main HEAD)"
50            git checkout "$PR_FORK_POINT"
51        else
52            git checkout "$(git log -1 --format=%H)"~1
53        fi
54
55        PARENT_COMMIT_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
56
57        [[ "$CURRENT_VERSION" == "$PARENT_COMMIT_VERSION" ]] && \
58            echo "version_changed=false" >> "$GITHUB_OUTPUT" || \
59            echo "version_changed=true" >> "$GITHUB_OUTPUT"
60
61        echo "current_version=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
62    outputs:
63      version_changed: ${{ steps.compare-versions-check.outputs.version_changed }}
64      current_version: ${{ steps.compare-versions-check.outputs.current_version }}
65    timeout-minutes: 1
66    defaults:
67      run:
68        shell: bash -euxo pipefail {0}
69        working-directory: ${{ inputs.working-directory }}
70  bump_extension_version:
71    needs:
72    - check_version_changed
73    if: |-
74      (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') &&
75      (inputs.force-bump == true || needs.check_version_changed.outputs.version_changed == 'false')
76    runs-on: namespace-profile-2x4-ubuntu-2404
77    steps:
78    - id: generate-token
79      name: steps::generate_token
80      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
81      with:
82        app-id: ${{ secrets.app-id }}
83        private-key: ${{ secrets.app-secret }}
84        owner: ${{ github.repository_owner }}
85        repositories: ${{ github.event.repository.name }}
86        permission-contents: write
87        permission-pull-requests: write
88    - name: steps::checkout_repo
89      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
90      with:
91        clean: false
92    - name: steps::cache_rust_dependencies_namespace
93      uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
94      with:
95        cache: rust
96        path: ~/.rustup
97    - name: extension_bump::install_bump_2_version
98      run: pip install bump2version --break-system-packages
99    - id: bump-version
100      name: extension_bump::bump_version
101      run: |
102        BUMP_FILES=("extension.toml")
103        if [[ -f "Cargo.toml" ]]; then
104            BUMP_FILES+=("Cargo.toml")
105        fi
106
107        bump2version \
108            --search "version = \"{current_version}"\" \
109            --replace "version = \"{new_version}"\" \
110            --current-version "$OLD_VERSION" \
111            --no-configured-files "$BUMP_TYPE" "${BUMP_FILES[@]}"
112
113        if [[ -f "Cargo.toml" ]]; then
114            cargo +stable update --workspace
115        fi
116
117        NEW_VERSION="$(sed -n 's/^version = \"\(.*\)\"/\1/p' < extension.toml | tr -d '[:space:]')"
118        EXTENSION_ID="$(sed -n 's/^id = "\(.*\)"/\1/p' < extension.toml | head -1 | tr -d '[:space:]')"
119        EXTENSION_NAME="$(sed -n 's/^name = "\(.*\)"/\1/p' < extension.toml | head -1 | tr -d '[:space:]')"
120
121        if [[ "$WORKING_DIR" == "." || -z "$WORKING_DIR" ]]; then
122            {
123                echo "title=Bump version to ${NEW_VERSION}";
124                echo "body=This PR bumps the version of this extension to v${NEW_VERSION}";
125                echo "branch_name=zed-zippy-autobump";
126            } >> "$GITHUB_OUTPUT"
127        else
128            {
129                echo "title=${EXTENSION_ID}: Bump to v${NEW_VERSION}";
130                echo "body<<EOF";
131                echo "This PR bumps the version of the ${EXTENSION_NAME} extension to v${NEW_VERSION}.";
132                echo "";
133                echo "Release Notes:";
134                echo "";
135                echo "- N/A";
136                echo "EOF";
137                echo "branch_name=zed-zippy-${EXTENSION_ID}-autobump";
138            } >> "$GITHUB_OUTPUT"
139        fi
140
141        echo "new_version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
142      env:
143        OLD_VERSION: ${{ needs.check_version_changed.outputs.current_version }}
144        BUMP_TYPE: ${{ inputs.bump-type }}
145        WORKING_DIR: ${{ inputs.working-directory }}
146    - name: steps::create_pull_request
147      uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
148      with:
149        title: ${{ steps.bump-version.outputs.title }}
150        body: ${{ steps.bump-version.outputs.body }}
151        commit-message: ${{ steps.bump-version.outputs.title }}
152        branch: ${{ steps.bump-version.outputs.branch_name }}
153        committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
154        author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
155        base: main
156        delete-branch: true
157        token: ${{ steps.generate-token.outputs.token }}
158        sign-commits: true
159        assignees: ${{ github.actor }}
160    timeout-minutes: 5
161    defaults:
162      run:
163        shell: bash -euxo pipefail {0}
164        working-directory: ${{ inputs.working-directory }}
165  create_version_label:
166    needs:
167    - check_version_changed
168    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.check_version_changed.outputs.version_changed == 'true'
169    runs-on: namespace-profile-2x4-ubuntu-2404
170    steps:
171    - id: generate-token
172      name: steps::generate_token
173      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
174      with:
175        app-id: ${{ secrets.app-id }}
176        private-key: ${{ secrets.app-secret }}
177        owner: ${{ github.repository_owner }}
178        repositories: ${{ github.event.repository.name }}
179        permission-contents: write
180    - name: steps::checkout_repo
181      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
182      with:
183        clean: false
184    - id: determine-tag
185      name: extension_bump::determine_tag
186      run: |
187        EXTENSION_ID="$(sed -n 's/^id = "\(.*\)"/\1/p' < extension.toml | head -1 | tr -d '[:space:]')"
188
189        if [[ "$WORKING_DIR" == "." || -z "$WORKING_DIR" ]]; then
190            TAG="v${CURRENT_VERSION}"
191        else
192            TAG="${EXTENSION_ID}-v${CURRENT_VERSION}"
193        fi
194
195        echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
196      env:
197        CURRENT_VERSION: ${{ needs.check_version_changed.outputs.current_version }}
198        WORKING_DIR: ${{ inputs.working-directory }}
199    - name: steps::create_tag
200      uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
201      with:
202        script: |
203          github.rest.git.createRef({
204              owner: context.repo.owner,
205              repo: context.repo.repo,
206              ref: 'refs/tags/${{ steps.determine-tag.outputs.tag }}',
207              sha: context.sha
208          })
209        github-token: ${{ steps.generate-token.outputs.token }}
210    outputs:
211      tag: ${{ steps.determine-tag.outputs.tag }}
212    timeout-minutes: 1
213    defaults:
214      run:
215        shell: bash -euxo pipefail {0}
216        working-directory: ${{ inputs.working-directory }}
217  trigger_release:
218    needs:
219    - check_version_changed
220    - create_version_label
221    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
222    runs-on: namespace-profile-2x4-ubuntu-2404
223    steps:
224    - id: generate-token
225      name: steps::generate_token
226      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
227      with:
228        app-id: ${{ secrets.app-id }}
229        private-key: ${{ secrets.app-secret }}
230        owner: zed-industries
231        repositories: extensions
232        permission-contents: write
233        permission-issues: write
234        permission-members: read
235        permission-pull-requests: write
236    - name: steps::checkout_repo
237      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
238      with:
239        clean: false
240    - id: get-extension-id
241      name: extension_bump::get_extension_id
242      run: |
243        EXTENSION_ID="$(sed -n 's/id = \"\(.*\)\"/\1/p' < extension.toml)"
244
245        echo "extension_id=${EXTENSION_ID}" >> "$GITHUB_OUTPUT"
246    - id: extension-update
247      name: extension_bump::release_action
248      uses: huacnlee/zed-extension-action@82920ff0876879f65ffbcfa3403589114a8919c6
249      with:
250        extension-name: ${{ steps.get-extension-id.outputs.extension_id }}
251        push-to: zed-industries/extensions
252        tag: ${{ needs.create_version_label.outputs.tag }}
253      env:
254        COMMITTER_TOKEN: ${{ steps.generate-token.outputs.token }}
255    - name: enable_automerge_if_staff
256      uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
257      with:
258        script: |
259          const prNumber = process.env.PR_NUMBER;
260          if (!prNumber) {
261              console.log('No pull request number set, skipping automerge.');
262              return;
263          }
264
265          const author = process.env.GITHUB_ACTOR;
266          let isStaff = false;
267          try {
268              const response = await github.rest.teams.getMembershipForUserInOrg({
269                  org: 'zed-industries',
270                  team_slug: 'staff',
271                  username: author
272              });
273              isStaff = response.data.state === 'active';
274          } catch (error) {
275              if (error.status !== 404) {
276                  throw error;
277              }
278          }
279
280          if (!isStaff) {
281              console.log(`Actor ${author} is not a staff member, skipping automerge.`);
282              return;
283          }
284
285          // Assign staff member responsible for the bump
286          const pullNumber = parseInt(prNumber);
287
288          await github.rest.issues.addAssignees({
289              owner: 'zed-industries',
290              repo: 'extensions',
291              issue_number: pullNumber,
292              assignees: [author]
293          });
294          console.log(`Assigned ${author} to PR #${prNumber} in zed-industries/extensions`);
295
296          // Get the GraphQL node ID
297          const { data: pr } = await github.rest.pulls.get({
298              owner: 'zed-industries',
299              repo: 'extensions',
300              pull_number: pullNumber
301          });
302
303          await github.graphql(`
304              mutation($pullRequestId: ID!) {
305                  enablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId, mergeMethod: SQUASH }) {
306                      pullRequest {
307                          autoMergeRequest {
308                              enabledAt
309                          }
310                      }
311                  }
312              }
313          `, { pullRequestId: pr.node_id });
314
315          console.log(`Automerge enabled for PR #${prNumber} in zed-industries/extensions`);
316        github-token: ${{ steps.generate-token.outputs.token }}
317      env:
318        PR_NUMBER: ${{ steps.extension-update.outputs.pull-request-number }}
319    defaults:
320      run:
321        shell: bash -euxo pipefail {0}
322        working-directory: ${{ inputs.working-directory }}
323concurrency:
324  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}extension-bump
325  cancel-in-progress: true
326defaults:
327  run:
328    shell: bash -euxo pipefail {0}
329
Served at tenant.openagents/omega Member data and write actions are omitted.