Skip to content

Commit 756db7c

Browse files
committed
ci: automate releases on every push to main
1 parent f366b74 commit 756db7c

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

β€Ž.github/workflows/ci-cd.ymlβ€Ž

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ on:
88
pull_request:
99
branches: [main, master, develop]
1010
workflow_dispatch:
11-
inputs:
12-
create_release:
13-
description: 'Create a GitHub Release?'
14-
required: true
15-
type: boolean
16-
default: false
1711

1812
env:
1913
NODE_VERSION: '22'
@@ -110,19 +104,20 @@ jobs:
110104
retention-days: 7
111105

112106
# ============================================================
113-
# Release Logic
107+
# Release Logic (Automated for Push to Main)
114108
# ============================================================
115-
- name: πŸš€ Create GitHub Release
116-
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.create_release == 'true'
109+
- name: πŸš€ Create/Update Release
110+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
117111
uses: softprops/action-gh-release@v2
118112
with:
119113
files: dist/remote-opencode.exe
120-
# If triggered by tag, use tag name. If manual, use 'latest-manual'
121-
name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'Manual Release' }}
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)' }}
122116
tag_name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || 'latest' }}
123117
draft: false
124-
prerelease: false
118+
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }} # Mark rolling builds as pre-release
125119
generate_release_notes: true
120+
make_latest: ${{ startsWith(github.ref, 'refs/tags/v') && 'true' || 'false' }}
126121
env:
127122
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128123

@@ -140,7 +135,7 @@ jobs:
140135
- πŸ§ͺ Unit Tests: Passed
141136
- πŸ—οΈ Build EXE: Standalone Windows binary generated successfully.
142137
143-
The standalone EXE is available in the **Artifacts** section of this run. πŸŽ‰`;
138+
This PR is ready to be merged. Once merged to main, a new **Latest Build** release will be automatically created! πŸŽ‰`;
144139
145140
github.rest.issues.createComment({
146141
issue_number: context.issue.number,

0 commit comments

Comments
Β (0)