mirror of
https://github.com/ergosteur/ssh-protocol-handler-win.git
synced 2026-04-19 13:39:33 -04:00
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*' # Triggers only on tags starting with 'v' (e.g., v1.0.0)
|
|
workflow_dispatch: # Allows manual runs from the Actions tab
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
permissions:
|
|
contents: write # Essential for creating the release and uploading assets
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 8.0.x
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Build and publish self-contained executable
|
|
run: >
|
|
dotnet publish --configuration Release --runtime win-x64
|
|
--self-contained true /p:PublishSingleFile=true
|
|
/p:IncludeNativeLibrariesForSelfExtract=true
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/') # Only runs if the trigger was a tag
|
|
with:
|
|
files: ${{ github.workspace }}/SshHandler/bin/Release/net8.0-windows/win-x64/publish/SshHandler.exe
|
|
generate_release_notes: true
|
|
draft: false
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload artifact (Manual Run fallback)
|
|
uses: actions/upload-artifact@v4
|
|
if: always() # Still uploads the artifact even if it wasn't a tag run
|
|
with:
|
|
name: SshHandler-Windows-Executable
|
|
path: ${{ github.workspace }}/SshHandler/bin/Release/net8.0-windows/win-x64/publish/SshHandler.exe
|