Skip to content
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion .github/workflows/create-tag-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ jobs:
if (prs?.length > 0) {
const pull_number = prs[0].number;
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });

// Extract content between gitstream placeholders, excluding header and footer
let releaseNote = pr.title;

if (pr.body) {
const contentMatch = pr.body.match(/<!--start_gitstream_placeholder-->.*?### ✨ PR Description\s*(.*?)\s*_Generated by LinearB AI.*?<!--end_gitstream_placeholder-->/s);

if (contentMatch) {
Comment thread
MishaKav marked this conversation as resolved.
Outdated
releaseNote = contentMatch[1].trim();
Comment thread
MishaKav marked this conversation as resolved.
Outdated
}
}

core.setOutput('pr-title', pr.title);
core.setOutput('release-notes', releaseNote);
core.setOutput('pr-number', pr.number);

return pr.labels.some(label => label.name.includes('auto-deploy'));
}
return false;
Expand All @@ -49,6 +65,30 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create $NEW_TAG --generate-notes
PR_TITLE="${{ steps.should-deploy.outputs.pr-title }}"
RELEASE_NOTES="${{ steps.should-deploy.outputs.release-notes }}"
PR_NUMBER="${{ steps.should-deploy.outputs.pr-number }}"

# Create release notes with PR title, description, and link
cat > release_notes.md << EOF
## What's Changed

${PR_TITLE} in [#${PR_NUMBER}](https://github.com/${{ github.repository }}/pull/${PR_NUMBER})

Comment thread
MishaKav marked this conversation as resolved.
${RELEASE_NOTES}
Comment thread
MishaKav marked this conversation as resolved.
EOF
Comment thread
MishaKav marked this conversation as resolved.

Comment thread
MishaKav marked this conversation as resolved.
Comment thread
MishaKav marked this conversation as resolved.
gh release create $NEW_TAG --notes-file release_notes.md
git checkout $NEW_TAG
npm run update-v2-tag

- name: Update v2-lite
if: steps.should-deploy.outputs.result == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout v2-lite
git checkout $NEW_TAG package.json package-lock.json dist/
Comment thread
MishaKav marked this conversation as resolved.
git add package.json package-lock.json dist/
git commit -m "Update v2-lite to $NEW_TAG"
git push origin v2-lite
Comment thread
MishaKav marked this conversation as resolved.