Skip to content

chore: release v5.48.1 #122

chore: release v5.48.1

chore: release v5.48.1 #122

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
- name: Generate changelog
id: changelog
run: |
PREV_TAG=$(git tag --sort=-version:refname | grep -v "${{ steps.version.outputs.VERSION }}" | head -1)
if [ -n "$PREV_TAG" ]; then
LOG=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s" --no-merges)
else
LOG=$(git log --pretty=format:"- %s" --no-merges | head -20)
fi
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "$LOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: actions/github-script@v7
with:
script: |
const baseTag = '${{ steps.version.outputs.VERSION }}';
const body = `## What's Changed\n\n${{ steps.changelog.outputs.CHANGELOG }}\n\n## Installation\n\n\`\`\`bash\n# Run latest version directly\nnpx github:Lexus2016/claude-code-studio\n\n# Or install globally\nnpm install -g github:Lexus2016/claude-code-studio\nclaude-code-studio\n\`\`\`\n\n> Open http://localhost:3000 in your browser`;
try {
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: baseTag,
target_commitish: context.sha,
name: 'Claude Code Studio ' + baseTag,
body,
draft: false,
prerelease: false,
});
core.info(`Release ${baseTag} created successfully`);
} catch (e) {
const isAlreadyExists = e.status === 422 &&
e.response?.data?.errors?.some(err => err.code === 'already_exists');
if (isAlreadyExists) {
core.info(`Release ${baseTag} already exists — skipping (was likely created manually)`);
} else {
throw e;
}
}