Files
Needlework.Net/.github/workflows/release.yml
BlossomiShymae a90da0289c Update
2024-08-09 08:06:58 -05:00

42 lines
1.4 KiB
YAML

# .github/workflows/release.yml
on:
push:
branches:
- release
jobs:
build:
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
steps:
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: release
- name: Build
run: dotnet build Needlework.Net.Desktop -c Release
- name: Publish
run: dotnet publish Needlework.Net.Desktop -c Release -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false -o publish -r win-x64 --self-contained=false
- name: Version
id: ver
shell: powershell
run: |
$xml=[xml](Get-Content .\Needlework.Net.Desktop\Needlework.Net.Desktop.csproj)
$ver=($xml.Project.PropertyGroup).AssemblyVersion
echo "VERSION=$ver" >> "$GITHUB_OUTPUT"
- name: Zip
run: 7z a -tzip NeedleworkDotNet-win-x64.zip ./Publish/* README.md LICENSE
- name: Release
uses: softprops/action-gh-release@v1
with:
name: "Needlework.Net v${{ steps.ver.outputs.VERSION }}"
prerelease: true
tag_name: "${{ steps.ver.outputs.VERSION }}"
files: |
Publish/NeedleworkDotNet-win-x64.zip