Skip to content

Commit

Permalink
Update build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMeepso authored Nov 6, 2024
1 parent 47d631d commit 29b2a51
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Publish and Release on Commit
name: Publish Nightly Release on Commit

on:
push:
branches:
- main # Trigger workflow on push to the main branch; change this as needed
- main # Trigger on pushes to main branch

jobs:
build:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x' # Use the appropriate version
dotnet-version: '6.0.x' # Specify your .NET version

# Step 3: Restore dependencies
- name: Restore dependencies
Expand All @@ -28,25 +28,29 @@ jobs:
- name: Publish the application
run: dotnet publish -c Release -o ./publish # Output to ./publish folder

# Step 5: Create a release
# Step 5: Zip the publish folder
- name: Zip the publish folder
run: zip -r ./publish/published_app.zip ./publish

# Step 6: Create a nightly release
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
tag_name: "nightly" # Static tag name for nightly builds
release_name: "nightly-${{ github.run_number }}" # Unique name for each run
draft: false
prerelease: false
prerelease: true # Mark as prerelease if you want to differentiate

# Step 6: Upload published files to release
# Step 7: Upload published files to release
- name: Upload .NET Publish Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./publish
asset_path: ./publish/published_app.zip
asset_name: published_app.zip
asset_content_type: application/zip

0 comments on commit 29b2a51

Please sign in to comment.