Skip to content

Commit c2f2089

Browse files
committed
Create release on tags.
1 parent 1125fad commit c2f2089

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

.github/workflows/build-windows.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: Build Windows Binary
1+
name: Windows Build and Release
22
on:
3-
push:
3+
push: # Run on every push
44
branches:
55
- main
6-
pull_request:
6+
- develop
7+
- 'feature/*' # Optional: Runs on feature branches
8+
tags:
9+
- 'v*' # Triggers release only on version tags
710
jobs:
811
build:
912
runs-on: windows-latest
@@ -24,3 +27,25 @@ jobs:
2427
name: windows-binary
2528
path: target/release/*.exe
2629
retention-days: 7 # Keep artifacts for 7 days
30+
release:
31+
name: Create GitHub Release
32+
needs: build # Ensure build completes first
33+
if: startsWith(github.ref, 'refs/tags/') # Only run on tags
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Download Windows Binary
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: windows-binary
40+
path: artifacts
41+
- name: Create Release
42+
uses: softprops/action-gh-release@v2
43+
with:
44+
tag_name: ${{ github.ref_name }}
45+
name: Release ${{ github.ref_name }}
46+
draft: false
47+
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
48+
generate_release_notes: true
49+
files: artifacts/*
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)