Skip to content

Commit 8614f0d

Browse files
committed
feat: new ci flow
1 parent ed156a6 commit 8614f0d

File tree

2 files changed

+50
-136
lines changed

2 files changed

+50
-136
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [main]
88

9+
permissions:
10+
contents: write # Required for creating draft releases
11+
912
env:
1013
VERSION: '' # Will be set from package.json
1114

@@ -131,3 +134,50 @@ jobs:
131134
name: GhostDraw-${{ env.VERSION }}-portable
132135
path: GhostDraw-${{ env.VERSION }}-portable.zip
133136
retention-days: 30
137+
138+
# Only create/update draft release if the tag doesn't exist yet
139+
# This allows CI to run safely whether tag exists or not
140+
- name: Check if tag exists
141+
id: check_tag
142+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
143+
shell: pwsh
144+
run: |
145+
$tagName = "v${{ env.VERSION }}"
146+
git fetch --tags
147+
$tagExists = git tag -l $tagName
148+
if ($tagExists) {
149+
Write-Host "Tag $tagName already exists - skipping draft release"
150+
echo "tag_exists=true" >> $env:GITHUB_OUTPUT
151+
} else {
152+
Write-Host "Tag $tagName does not exist - will create/update draft release"
153+
echo "tag_exists=false" >> $env:GITHUB_OUTPUT
154+
}
155+
156+
- name: Create or update draft release
157+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_tag.outputs.tag_exists == 'false'
158+
uses: softprops/action-gh-release@v2
159+
with:
160+
tag_name: v${{ env.VERSION }}
161+
name: GhostDraw v${{ env.VERSION }}
162+
draft: true
163+
prerelease: false
164+
generate_release_notes: true
165+
files: |
166+
Installer/bin/x64/Release/GhostDrawSetup-${{ env.VERSION }}.msi
167+
GhostDraw-${{ env.VERSION }}-portable.zip
168+
body: |
169+
## GhostDraw v${{ env.VERSION }}
170+
171+
### Downloads
172+
- **GhostDrawSetup-${{ env.VERSION }}.msi** - Windows installer
173+
- **GhostDraw-${{ env.VERSION }}-portable.zip** - Portable version (no installation required)
174+
175+
### Installation
176+
1. Download the MSI installer or portable ZIP
177+
2. Run the installer or extract the ZIP to a folder of your choice
178+
3. Launch GhostDraw from the Start Menu or the extracted folder
179+
180+
---
181+
*Edit this draft to add release notes, then publish when ready.*
182+
env:
183+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)