publish_extension_cli.yml

  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-2x4-ubuntu-2404
 15    steps:
 16    - name: steps::checkout_repo
 17      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 18      with:
 19        clean: false
 20    - name: steps::cache_rust_dependencies_namespace
 21      uses: namespacelabs/nscloud-cache-action@v1
 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: extension_bump::generate_token
 42      uses: actions/create-github-app-token@v2
 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@11bd71901bbe5b1630ceea73d27597364c9af683
 48      with:
 49        clean: false
 50    - name: steps::cache_rust_dependencies_namespace
 51      uses: namespacelabs/nscloud-cache-action@v1
 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: publish_extension_cli::create_pull_request_zed
 66      uses: peter-evans/create-pull-request@v7
 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        base: main
 79        delete-branch: true
 80        token: ${{ steps.generate-token.outputs.token }}
 81        sign-commits: true
 82        assignees: ${{ github.actor }}
 83  update_sha_in_extensions:
 84    needs:
 85    - publish_job
 86    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
 87    runs-on: namespace-profile-2x4-ubuntu-2404
 88    steps:
 89    - id: generate-token
 90      name: extension_bump::generate_token
 91      uses: actions/create-github-app-token@v2
 92      with:
 93        app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
 94        private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
 95        owner: zed-industries
 96        repositories: extensions
 97    - id: short-sha
 98      name: publish_extension_cli::get_short_sha
 99      run: |
100        echo "sha_short=$(echo "${{ github.sha }}" | cut -c1-7)" >> "$GITHUB_OUTPUT"
101    - name: publish_extension_cli::update_sha_in_extensions::checkout_extensions_repo
102      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
103      with:
104        repository: zed-industries/extensions
105        token: ${{ steps.generate-token.outputs.token }}
106    - name: publish_extension_cli::update_sha_in_extensions::replace_sha
107      run: |
108        sed -i "s/ZED_EXTENSION_CLI_SHA: [a-f0-9]*/ZED_EXTENSION_CLI_SHA: ${{ github.sha }}/" \
109            .github/workflows/ci.yml
110    - name: publish_extension_cli::create_pull_request_extensions
111      uses: peter-evans/create-pull-request@v7
112      with:
113        title: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`
114        body: |
115          This PR bumps the extension CLI version to https://github.com/zed-industries/zed/commit/${{ github.sha }}.
116        commit-message: Bump extension CLI version to `${{ steps.short-sha.outputs.sha_short }}`
117        branch: update-extension-cli-sha
118        committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
119        base: main
120        delete-branch: true
121        token: ${{ steps.generate-token.outputs.token }}
122        sign-commits: true
123        labels: allow-no-extension
124        assignees: ${{ github.actor }}
125defaults:
126  run:
127    shell: bash -euxo pipefail {0}