Skip to content

Update README to enhance TornadoVM performance section and clarify GP… #6

Update README to enhance TornadoVM performance section and clarify GP…

Update README to enhance TornadoVM performance section and clarify GP… #6

name: Finalize GPULlama3 Release
on:
pull_request:
types: [closed]
branches: [main]
workflow_dispatch:
inputs:
version:
description: 'Release version to tag (e.g., 0.2.3)'
required: true
type: string
jobs:
create-release-tag:
# Run when release PR merges OR manual trigger
if: |
github.repository == 'beehive-lab/GPULlama3.java' &&
((github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')) ||
github.event_name == 'workflow_dispatch')
runs-on: [self-hosted, Linux, x64]
permissions:
contents: write
timeout-minutes: 10
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Get version
id: get_version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
BRANCH="${{ github.event.pull_request.head.ref }}"
echo "version=${BRANCH#release/}" >> $GITHUB_OUTPUT
fi
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create and push tag
run: |
VERSION="${{ steps.get_version.outputs.version }}"
git tag -a "v${VERSION}" -m "Release ${VERSION}"
git push origin "v${VERSION}"
echo "✅ Created tag v${VERSION}"
- name: Extract changelog for release notes
id: changelog
run: |
VERSION="${{ steps.get_version.outputs.version }}"
CHANGELOG_FILE="CHANGELOG.md"
RELEASE_NOTES="${{ runner.temp }}/release_notes.txt"
if [ -f "$CHANGELOG_FILE" ]; then
# Extract section for this version
awk -v ver="## \\[${VERSION}\\]" '
$0 ~ ver { found=1; next }
found && /^## \[/ { exit }
found { print }
' "$CHANGELOG_FILE" > "$RELEASE_NOTES"
if [ -s "$RELEASE_NOTES" ]; then
echo "Found changelog section for ${VERSION}"
else
echo "See CHANGELOG.md for details." > "$RELEASE_NOTES"
fi
else
echo "See commit history for changes." > "$RELEASE_NOTES"
fi
- name: Create GitHub Release
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const version = '${{ steps.get_version.outputs.version }}';
let releaseNotes;
try {
releaseNotes = fs.readFileSync('${{ runner.temp }}/release_notes.txt', 'utf8').trim();
if (!releaseNotes) {
releaseNotes = `Release ${version}`;
}
} catch (e) {
releaseNotes = `Release ${version}`;
}
// Add installation instructions
releaseNotes += `\n\n---\n\n### 📦 Installation\n\n`;
releaseNotes += `**Maven**\n\`\`\`xml\n<dependency>\n <groupId>io.github.beehive-lab</groupId>\n <artifactId>gpu-llama3</artifactId>\n <version>${version}</version>\n</dependency>\n\`\`\`\n\n`;
releaseNotes += `**Gradle**\n\`\`\`groovy\nimplementation 'io.github.beehive-lab:gpu-llama3:${version}'\n\`\`\`\n\n`;
releaseNotes += `---\n\n📖 [Documentation](https://github.com/beehive-lab/GPULlama3.java#readme) | 🔗 [Maven Central](https://central.sonatype.com/artifact/io.github.beehive-lab/gpu-llama3/${version})`;
const { data: release } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `v${version}`,
name: `GPULlama3.java ${version}`,
body: releaseNotes,
draft: false,
prerelease: false
});
console.log(`✅ Created release: ${release.html_url}`);
- name: Summary
run: |
VERSION="${{ steps.get_version.outputs.version }}"
echo "## 🎉 Release v${VERSION} Finalized" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Step | Status |" >> $GITHUB_STEP_SUMMARY
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Tag created | ✅ v${VERSION} |" >> $GITHUB_STEP_SUMMARY
echo "| GitHub Release | ✅ Created |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔄 Next:" >> $GITHUB_STEP_SUMMARY
echo "**Deploy to Maven Central** workflow will trigger automatically" >> $GITHUB_STEP_SUMMARY
cleanup-branch:
needs: create-release-tag
runs-on: [self-hosted, Linux, x64]
permissions:
contents: write
if: github.repository == 'beehive-lab/GPULlama3.java' && github.event_name == 'pull_request'
steps:
- name: Delete release branch
uses: actions/github-script@v7
with:
script: |
const branch = '${{ github.event.pull_request.head.ref }}';
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${branch}`
});
console.log(`✅ Deleted branch: ${branch}`);
} catch (e) {
console.log(`Could not delete branch: ${e.message}`);
}