mirror of
https://github.com/unclshura/splitter.git
synced 2026-06-22 00:22:01 +00:00
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: Build and Publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 10.0.x
|
|
|
|
- name: Restore
|
|
run: dotnet restore -r win-x64
|
|
|
|
- name: 'Get Version'
|
|
id: version
|
|
uses: battila7/get-version-action@v2
|
|
|
|
- name: Publish Release
|
|
run: dotnet publish -c Release -r win-x64 --self-contained true /p:Version=${{ steps.version.outputs.version-without-v }} /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }}
|
|
|
|
- name: Create ZIP
|
|
shell: pwsh
|
|
run: |
|
|
$publish = "splitter-cli/bin/Release/net10.0/win-x64/publish"
|
|
$version = "${{ steps.version.outputs.version-without-v }}"
|
|
$zip = "splitter-win-x64-$version.zip"
|
|
|
|
if (Test-Path $zip) { Remove-Item $zip }
|
|
Compress-Archive -Path "$publish/*" -DestinationPath $zip
|
|
|
|
Write-Host "Created $zip"
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
name: "Release ${{ github.ref_name }}"
|
|
files: splitter-win-x64-${{ steps.version.outputs.version-without-v }}.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|