Skip to content

Commit ff77014

Browse files
committed
ci: add release plugin pipeline into zed registry
1 parent d130a31 commit ff77014

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release Plugin into Zed Store
2+
3+
on:
4+
# Defining workflow_call means that this workflow can be called from
5+
# your main workflow job
6+
workflow_call:
7+
# cargo-dist exposes the plan from the plan step, as a JSON string,
8+
# to your job if it needs it
9+
inputs:
10+
plan:
11+
required: true
12+
type: string
13+
14+
jobs:
15+
publish-extension:
16+
name: Release Zed Extension
17+
runs-on: ubuntu-latest
18+
if: ${{ inputs.plan && fromJson(inputs.plan).announcement_is_prerelease != false }}
19+
steps:
20+
- uses: huacnlee/zed-extension-action@v1
21+
with:
22+
extension-name: dotenv-zed
23+
push-to: RustLangES/zed-extensions
24+
env:
25+
# the personal access token should have "repo" & "workflow" scopes
26+
COMMITTER_TOKEN: ${{ secrets.ZED_PLUGIN_COMMITTER_TOKEN }}

.github/workflows/release.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/
2+
#
13
# Copyright 2022-2024, axodotdev
24
# SPDX-License-Identifier: MIT or Apache-2.0
35
#
@@ -61,7 +63,7 @@ jobs:
6163
# we specify bash to get pipefail; it guards against the `curl` command
6264
# failing. otherwise `sh` won't catch that `curl` returned non-0
6365
shell: bash
64-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.0/cargo-dist-installer.sh | sh"
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.22.1/cargo-dist-installer.sh | sh"
6567
- name: Cache cargo-dist
6668
uses: actions/upload-artifact@v4
6769
with:
@@ -299,20 +301,55 @@ jobs:
299301
name=$(echo "$filename" | sed "s/\.rb$//")
300302
version=$(echo "$release" | jq .app_version --raw-output)
301303
304+
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
305+
brew update
306+
# We avoid reformatting user-provided data such as the app description and homepage.
307+
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
308+
302309
git add "Formula/${filename}"
303310
git commit -m "${name} ${version}"
304311
done
305312
git push
306313
314+
custom-cliff:
315+
needs:
316+
- plan
317+
- host
318+
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
319+
uses: ./.github/workflows/cliff.yml
320+
with:
321+
plan: ${{ needs.plan.outputs.val }}
322+
secrets: inherit
323+
# publish jobs get escalated permissions
324+
permissions:
325+
"id-token": "write"
326+
"packages": "write"
327+
328+
custom-publish-plugin:
329+
needs:
330+
- plan
331+
- host
332+
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
333+
uses: ./.github/workflows/publish-plugin.yml
334+
with:
335+
plan: ${{ needs.plan.outputs.val }}
336+
secrets: inherit
337+
# publish jobs get escalated permissions
338+
permissions:
339+
"id-token": "write"
340+
"packages": "write"
341+
307342
announce:
308343
needs:
309344
- plan
310345
- host
311346
- publish-homebrew-formula
347+
- custom-cliff
348+
- custom-publish-plugin
312349
# use "always() && ..." to allow us to wait for all publish jobs while
313350
# still allowing individual publish jobs to skip themselves (for prereleases).
314351
# "host" however must run to completion, no skipping allowed!
315-
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
352+
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') && (needs.custom-cliff.result == 'skipped' || needs.custom-cliff.result == 'success') && (needs.custom-publish-plugin.result == 'skipped' || needs.custom-publish-plugin.result == 'success') }}
316353
runs-on: "ubuntu-20.04"
317354
env:
318355
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lto = "thin"
2525
# Config for 'cargo dist'
2626
[workspace.metadata.dist]
2727
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
28-
cargo-dist-version = "0.21.0"
28+
cargo-dist-version = "0.22.1"
2929
# CI backends to support
3030
ci = "github"
3131
# The installers to generate for each app
@@ -37,6 +37,6 @@ targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-
3737
# Path that installers should place binaries in
3838
install-path = "CARGO_HOME"
3939
# Publish jobs to run in CI
40-
publish-jobs = ["homebrew", "./cliff"]
40+
publish-jobs = ["homebrew", "./cliff", "./publish-plugin"]
4141
# Whether to install an updater program
4242
install-updater = false

0 commit comments

Comments
 (0)