Skip to content

Commit 0d4d0a3

Browse files
DrewAPictureclaude
andcommitted
Attach agent zip to stable release instead of creating a separate release
Replaces the separate agent prerelease with a direct asset upload to the stable release via gh release upload. Drops the commit SHA resolution, release title fetch, release notes, and checksum steps that only existed to support the standalone release. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 62a412d commit 0d4d0a3

1 file changed

Lines changed: 10 additions & 59 deletions

File tree

.github/workflows/agent-release.yaml

Lines changed: 10 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77
inputs:
88
release_tag:
9-
description: Existing stable release tag to package (e.g. v1.2.3)
9+
description: Existing stable release tag to attach the agent zip to (e.g. v1.2.3)
1010
required: true
1111
type: string
1212

@@ -38,33 +38,19 @@ jobs:
3838
exit 1
3939
fi
4040
41-
agent_tag="${source_tag}-agent"
4241
agent_zip="${PLUGIN_SLUG}-${source_tag}-agent.zip"
4342
stable_zip="${PLUGIN_SLUG}-${source_tag}-stable-check.zip"
4443
4544
echo "source_tag=${source_tag}" >> "${GITHUB_OUTPUT}"
46-
echo "agent_tag=${agent_tag}" >> "${GITHUB_OUTPUT}"
4745
echo "agent_zip=${agent_zip}" >> "${GITHUB_OUTPUT}"
4846
echo "stable_zip=${stable_zip}" >> "${GITHUB_OUTPUT}"
4947
50-
5148
- name: Checkout source tag
5249
uses: actions/checkout@v4
5350
with:
5451
fetch-depth: 0
5552
ref: ${{ steps.meta.outputs.source_tag }}
5653

57-
- name: Resolve source commit SHA
58-
id: commit
59-
shell: bash
60-
run: |
61-
set -euo pipefail
62-
# GitHub's API rejects a tag name as target_commitish when creating
63-
# a new release. Resolve to the underlying commit SHA here, after
64-
# checkout, when .git is available.
65-
source_sha="$(git rev-list -n 1 "refs/tags/${{ steps.meta.outputs.source_tag }}")"
66-
echo "source_sha=${source_sha}" >> "${GITHUB_OUTPUT}"
67-
6854
- name: Build stable package check archive
6955
shell: bash
7056
run: |
@@ -107,6 +93,7 @@ jobs:
10793
git archive \
10894
--worktree-attributes \
10995
--format=zip \
96+
--prefix=debug-bar-console/ \
11097
--output="dist/${{ steps.meta.outputs.agent_zip }}" \
11198
"${{ steps.meta.outputs.source_tag }}"
11299
@@ -118,9 +105,9 @@ jobs:
118105
archive_files="$(unzip -Z1 "${archive_path}")"
119106
120107
required_paths=(
121-
".agent/README.md"
122-
"AGENTS.md"
123-
"CLAUDE.md"
108+
"debug-bar-console/.agent/README.md"
109+
"debug-bar-console/AGENTS.md"
110+
"debug-bar-console/CLAUDE.md"
124111
)
125112
126113
for required_path in "${required_paths[@]}"; do
@@ -130,55 +117,19 @@ jobs:
130117
fi
131118
done
132119
133-
disallowed_pattern='^tests/|^\.github/|^\.claude/|^phpstan\.neon$|^phpunit\.xml$|^pint\.json$'
120+
disallowed_pattern='^debug-bar-console/tests/|^debug-bar-console/\.github/|^debug-bar-console/\.claude/|^debug-bar-console/phpstan\.neon$|^debug-bar-console/phpunit\.xml$|^debug-bar-console/pint\.json$'
134121
if echo "${archive_files}" | grep -E "${disallowed_pattern}" >/dev/null; then
135122
echo "Agent archive contains disallowed files." >&2
136123
echo "${archive_files}" | grep -E "${disallowed_pattern}" >&2 || true
137124
exit 1
138125
fi
139126
140-
- name: Fetch stable release title
141-
id: stable
127+
- name: Attach agent zip to stable release
142128
shell: bash
143129
env:
144130
GH_TOKEN: ${{ github.token }}
145131
run: |
146132
set -euo pipefail
147-
release_title="$(gh release view "${{ steps.meta.outputs.source_tag }}" --json name --jq '.name')"
148-
echo "release_title=${release_title}" >> "${GITHUB_OUTPUT}"
149-
echo "agent_title=${release_title}-agent" >> "${GITHUB_OUTPUT}"
150-
151-
- name: Generate release notes
152-
shell: bash
153-
run: |
154-
set -euo pipefail
155-
cat > dist/agent-release-notes.md << 'EOF'
156-
Agent variant of the [${{ steps.stable.outputs.release_title }} stable release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.meta.outputs.source_tag }}).
157-
158-
This package includes the following agent files not present in the stable release:
159-
160-
- `AGENTS.md`
161-
- `CLAUDE.md`
162-
- `.agent/` directory
163-
EOF
164-
165-
- name: Create checksums
166-
shell: bash
167-
run: |
168-
set -euo pipefail
169-
cd dist
170-
shasum -a 256 "${{ steps.meta.outputs.agent_zip }}" > "${{ steps.meta.outputs.agent_zip }}.sha256"
171-
172-
- name: Publish agent prerelease
173-
uses: softprops/action-gh-release@v2
174-
with:
175-
tag_name: ${{ steps.meta.outputs.agent_tag }}
176-
name: ${{ steps.stable.outputs.agent_title }}
177-
prerelease: true
178-
target_commitish: ${{ steps.commit.outputs.source_sha }}
179-
files: |
180-
dist/${{ steps.meta.outputs.agent_zip }}
181-
dist/${{ steps.meta.outputs.agent_zip }}.sha256
182-
fail_on_unmatched_files: true
183-
body_path: dist/agent-release-notes.md
184-
generate_release_notes: false
133+
gh release upload "${{ steps.meta.outputs.source_tag }}" \
134+
"dist/${{ steps.meta.outputs.agent_zip }}" \
135+
--clobber

0 commit comments

Comments
 (0)