Skip to content

Commit dd1dc48

Browse files
author
Claton Hendricks
committed
Add automatic release with zip artifact to build workflow
1 parent 03363aa commit dd1dc48

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
build:
1111
runs-on: windows-latest
12+
permissions:
13+
contents: write
1214

1315
steps:
1416
- uses: actions/checkout@v4
@@ -37,3 +39,20 @@ jobs:
3739
with:
3840
name: CrashDetectorwithAI-app
3941
path: bin/Release/net9.0-windows/
42+
43+
- name: Zip build output
44+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
45+
run: Compress-Archive -Path bin\Release\net9.0-windows\* -DestinationPath CrashDetectorwithAI.zip
46+
shell: pwsh
47+
48+
- name: Create or update Release
49+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
50+
uses: softprops/action-gh-release@v2
51+
with:
52+
tag_name: latest
53+
name: Latest Build
54+
body: "Automated build from commit ${{ github.sha }}"
55+
files: CrashDetectorwithAI.zip
56+
make_latest: true
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)