kv4p-sharp/.github/workflows/dotnet.yml

56 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2024-11-05 08:56:31 +08:00
name: Build and Release RadioGUI
2024-10-28 01:02:07 +08:00
on:
push:
2024-11-05 08:56:31 +08:00
branches:
- '**' # Run on all branches
tags:
- 'v*' # Also runs on tags starting with 'v*' (e.g., v1.0)
2024-10-28 01:02:07 +08:00
jobs:
build:
2024-11-05 08:56:31 +08:00
runs-on: windows-latest
2024-10-28 01:02:07 +08:00
steps:
2024-11-05 08:56:31 +08:00
- name: Checkout code
uses: actions/checkout@v3
2024-10-28 01:02:07 +08:00
- name: Setup .NET
2024-11-05 08:56:31 +08:00
uses: actions/setup-dotnet@v3
2024-10-28 01:02:07 +08:00
with:
2024-11-05 08:56:31 +08:00
dotnet-version: '7.x' # Use the appropriate .NET SDK version for your project
2024-10-28 01:02:07 +08:00
- name: Restore dependencies
run: dotnet restore
2024-11-05 08:56:31 +08:00
- name: Build Solution
run: dotnet build --configuration Release
- name: Publish binaries
run: dotnet publish RadioGUI/RadioGUI.csproj --configuration Release --output ./publish
- name: Upload binaries if successful
if: success()
uses: actions/upload-artifact@v3
with:
name: RadioGUI-binaries
path: ./publish
release:
runs-on: windows-latest
needs: build
if: github.ref_type == 'tag' && success() # Only release if a tag push and build was successful
steps:
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: RadioGUI-binaries
path: ./publish
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: ./publish/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}