Skip to content

Commit 807a83d

Browse files
committed
ci: improve auto-release branding and versioning
1 parent 756db7c commit 807a83d

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ jobs:
9393
- name: 📦 Install dependencies
9494
run: npm ci
9595

96+
- name: 🏷️ Get Version from package.json
97+
id: get_version
98+
shell: bash
99+
run: |
100+
VERSION=$(node -p "require('./package.json').version")
101+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
102+
96103
- name: 🔨 Build Standalone EXE
97104
run: npm run build:sea
98105

@@ -111,13 +118,14 @@ jobs:
111118
uses: softprops/action-gh-release@v2
112119
with:
113120
files: dist/remote-opencode.exe
114-
# If it's a tag, use tag name. Otherwise, use 'Latest Build'
115-
name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'Latest Build (Main)' }}
121+
# Dynamic name using the version from package.json
122+
name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || format('Release v{0}', steps.get_version.outputs.VERSION) }}
123+
# Use the tag from git if available, otherwise fallback to 'latest'
116124
tag_name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'latest' }}
117125
draft: false
118-
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }} # Mark rolling builds as pre-release
119-
generate_release_notes: true
120-
make_latest: ${{ startsWith(github.ref, 'refs/tags/v') && 'true' || 'false' }}
126+
prerelease: false # Force it to show as a "Main Release"
127+
generate_release_notes: true # This will populate the body with the commit log
128+
make_latest: true # Ensures this is the one users see first
121129
env:
122130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123131

@@ -135,7 +143,7 @@ jobs:
135143
- 🧪 Unit Tests: Passed
136144
- 🏗️ Build EXE: Standalone Windows binary generated successfully.
137145
138-
This PR is ready to be merged. Once merged to main, a new **Latest Build** release will be automatically created! 🎉`;
146+
This PR is ready to be merged. Once merged to main, a new **Main Release** will be automatically created! 🎉`;
139147
140148
github.rest.issues.createComment({
141149
issue_number: context.issue.number,

0 commit comments

Comments
 (0)