diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 16acbfa..285070f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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: @@ -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 @@ -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