Skip to content

Commit b6ea4f5

Browse files
committed
🪞 Use Iris to document Iris: add binary-path input for self-release
Teach Iris the ancient art of self-reflection. The release workflows now use pre-built artifacts to generate their own release notes and changelogs, creating a beautifully recursive loop where Iris describes her own evolution. Key improvements: - Add binary-path input to skip download/build when artifact exists - Switch from OpenAI to Anthropic for release note generation - Generate both changelog and release notes in CI/CD pipeline - Include changelog section in release assets - Add release notes preview to workflow summary - Quiet mode ensures clean markdown output without terminal noise The snake now eats its own tail, and it tastes like well-documented release automation.
1 parent e231ad8 commit b6ea4f5

File tree

3 files changed

+74
-16
lines changed

3 files changed

+74
-16
lines changed

.github/workflows/cicd.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,17 +361,38 @@ jobs:
361361
echo "tag=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
362362
echo "Previous tag: $PREVIOUS_TAG"
363363
364+
- name: 🔧 Prepare git-iris binary
365+
run: |
366+
chmod +x ./artifacts/git-iris-linux-amd64/git-iris
367+
echo "Binary ready: ./artifacts/git-iris-linux-amd64/git-iris"
368+
./artifacts/git-iris-linux-amd64/git-iris --version
369+
370+
- name: 📋 Generate changelog with Git-Iris
371+
id: changelog
372+
if: steps.prev_tag.outputs.tag != ''
373+
uses: ./
374+
with:
375+
command: changelog
376+
from: ${{ steps.prev_tag.outputs.tag }}
377+
to: ${{ github.ref_name }}
378+
version-name: ${{ github.ref_name }}
379+
provider: anthropic
380+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
381+
output-file: CHANGELOG_SECTION.md
382+
binary-path: ./artifacts/git-iris-linux-amd64/git-iris
383+
364384
- name: 📝 Generate release notes with Git-Iris
365385
id: release_notes
366386
if: steps.prev_tag.outputs.tag != ''
367387
uses: ./
368388
with:
389+
command: release-notes
369390
from: ${{ steps.prev_tag.outputs.tag }}
370391
to: ${{ github.ref_name }}
371-
provider: openai
372-
api-key: ${{ secrets.OPENAI_API_KEY }}
392+
provider: anthropic
393+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
373394
output-file: RELEASE_NOTES.md
374-
build-from-source: "true"
395+
binary-path: ./artifacts/git-iris-linux-amd64/git-iris
375396

376397
- name: 📝 Fallback release notes
377398
if: steps.prev_tag.outputs.tag == '' || steps.release_notes.outcome == 'failure'
@@ -388,6 +409,7 @@ jobs:
388409
prerelease: false
389410
files: |
390411
./release-assets/*
412+
CHANGELOG_SECTION.md
391413
body_path: RELEASE_NOTES.md
392414

393415
# Auto-update major version tag (v1, v2, etc.) for GitHub Action users

.github/workflows/release.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,17 @@ jobs:
100100
sed -i 's/^version = ".*"/version = "${{ steps.version.outputs.version }}"/' Cargo.toml
101101
echo "Updated Cargo.toml to version ${{ steps.version.outputs.version }}"
102102
103+
- name: "📦 Update Cargo.lock"
104+
run: cargo update -p git-iris
105+
103106
- name: "🔨 Build"
104107
run: cargo build --release --locked
105108

106109
- name: "🧪 Run tests"
107110
run: cargo test --locked
108111

109112
- name: "📋 Generate changelog"
110-
if: ${{ !inputs.skip_changelog && !inputs.dry_run && secrets.OPENAI_API_KEY != '' }}
113+
if: ${{ !inputs.skip_changelog && !inputs.dry_run }}
111114
uses: ./
112115
with:
113116
command: changelog
@@ -116,11 +119,22 @@ jobs:
116119
version-name: ${{ steps.version.outputs.version }}
117120
output-file: CHANGELOG.md
118121
update-file: "true"
119-
api-key: ${{ secrets.OPENAI_API_KEY }}
120-
build-from-source: "true"
122+
provider: anthropic
123+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
124+
binary-path: ./target/release/git-iris
121125

122-
- name: "📦 Update Cargo.lock"
123-
run: cargo update -p git-iris
126+
- name: "📝 Generate release notes"
127+
if: ${{ !inputs.dry_run }}
128+
id: release_notes
129+
uses: ./
130+
with:
131+
command: release-notes
132+
from: v${{ steps.version.outputs.current }}
133+
to: HEAD
134+
version-name: ${{ steps.version.outputs.version }}
135+
provider: anthropic
136+
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
137+
binary-path: ./target/release/git-iris
124138

125139
- name: "✨ Commit version bump"
126140
if: ${{ !inputs.dry_run }}
@@ -156,9 +170,15 @@ jobs:
156170
echo "- Build .deb and .rpm packages" >> $GITHUB_STEP_SUMMARY
157171
echo "- Publish Docker image to Docker Hub" >> $GITHUB_STEP_SUMMARY
158172
echo "- Publish to crates.io" >> $GITHUB_STEP_SUMMARY
159-
echo "- Generate release notes with git-iris" >> $GITHUB_STEP_SUMMARY
160-
echo "- Create GitHub Release" >> $GITHUB_STEP_SUMMARY
173+
echo "- Create GitHub Release with release notes" >> $GITHUB_STEP_SUMMARY
161174
echo "- Update v1 action tag" >> $GITHUB_STEP_SUMMARY
162175
echo "" >> $GITHUB_STEP_SUMMARY
163176
echo "📦 [View CI/CD progress](https://github.com/${{ github.repository }}/actions)" >> $GITHUB_STEP_SUMMARY
177+
echo "" >> $GITHUB_STEP_SUMMARY
178+
echo "---" >> $GITHUB_STEP_SUMMARY
179+
echo "### 📝 Release Notes Preview" >> $GITHUB_STEP_SUMMARY
180+
echo "" >> $GITHUB_STEP_SUMMARY
181+
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
182+
${{ steps.release_notes.outputs.content }}
183+
EOF
164184
fi

action.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ inputs:
4848
description: "Build from source instead of downloading binary"
4949
required: false
5050
default: "false"
51+
binary-path:
52+
description: "Path to pre-built git-iris binary (skips download and build)"
53+
required: false
5154

5255
outputs:
5356
content:
@@ -94,16 +97,23 @@ runs:
9497
;;
9598
esac
9699
100+
- name: Use pre-built binary
101+
if: inputs.binary-path != ''
102+
shell: bash
103+
run: |
104+
echo "Using pre-built binary: ${{ inputs.binary-path }}"
105+
echo "GIT_IRIS_BIN=${{ inputs.binary-path }}" >> $GITHUB_ENV
106+
97107
- name: Install Rust (for build-from-source)
98-
if: inputs.build-from-source == 'true'
108+
if: inputs.binary-path == '' && inputs.build-from-source == 'true'
99109
uses: dtolnay/rust-toolchain@stable
100110

101111
- name: Rust cache (for build-from-source)
102-
if: inputs.build-from-source == 'true'
112+
if: inputs.binary-path == '' && inputs.build-from-source == 'true'
103113
uses: Swatinem/rust-cache@v2
104114

105115
- name: Download git-iris binary
106-
if: inputs.build-from-source != 'true'
116+
if: inputs.binary-path == '' && inputs.build-from-source != 'true'
107117
shell: bash
108118
env:
109119
GH_TOKEN: ${{ github.token }}
@@ -131,7 +141,7 @@ runs:
131141
echo "::endgroup::"
132142
133143
- name: Build git-iris from source
134-
if: inputs.build-from-source == 'true'
144+
if: inputs.binary-path == '' && inputs.build-from-source == 'true'
135145
shell: bash
136146
run: |
137147
echo "::group::Building git-iris from source"
@@ -143,20 +153,26 @@ runs:
143153
id: generate
144154
shell: bash
145155
env:
156+
# LLM provider configuration
146157
OPENAI_API_KEY: ${{ inputs.provider == 'openai' && inputs.api-key || '' }}
147158
ANTHROPIC_API_KEY: ${{ inputs.provider == 'anthropic' && inputs.api-key || '' }}
148159
GOOGLE_API_KEY: ${{ inputs.provider == 'google' && inputs.api-key || '' }}
149160
IRIS_PROVIDER: ${{ inputs.provider }}
150161
IRIS_MODEL: ${{ inputs.model }}
151162
IRIS_INSTRUCTIONS: ${{ inputs.custom-instructions }}
163+
# Ensure clean markdown output - no colors or formatting
164+
NO_COLOR: "1"
165+
TERM: dumb
166+
CLICOLOR: "0"
167+
CLICOLOR_FORCE: "0"
152168
run: |
153169
echo "::group::Running git-iris ${{ inputs.command }}"
154170
155171
GIT_IRIS="${GIT_IRIS_BIN:-git-iris}"
156172
COMMAND="${{ inputs.command }}"
157173
158-
# Build base command
159-
CMD="$GIT_IRIS $COMMAND --from '${{ inputs.from }}' --to '${{ inputs.to }}' --raw"
174+
# Build base command (--raw ensures markdown output, --quiet suppresses spinners)
175+
CMD="$GIT_IRIS $COMMAND --from '${{ inputs.from }}' --to '${{ inputs.to }}' --raw --quiet"
160176
161177
# Add version name if specified
162178
if [ -n "${{ inputs.version-name }}" ]; then

0 commit comments

Comments
 (0)