Skip to content

Publish

Publish #10

Workflow file for this run

name: Publish
on:
workflow_dispatch:
permissions:
contents: write
jobs:
publish:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
- name: Publish
run: dotnet publish --framework net40 --configuration Release -p:DebugType=embedded -p:AssemblyVersion=$env:GitVersion_AssemblySemVer -p:FileVersion=$env:GitVersion_AssemblySemFileVer -p:InformationalVersion=$env:GitVersion_InformationalVersion
- name: Zip
run: 7z a -r ${{ format('CnCNet.LauncherStub-v{0}-net40.zip', env.GitVersion_SemVer) }} ./bin/Release/net40/publish/*.*
- name: Prerelease
if: ${{ env.GitVersion_PreReleaseTag != '' }}
run: gh release create ${{ format('v{0}', env.GitVersion_SemVer) }} (get-item *.zip) --generate-notes --target ${{ github.sha }} --prerelease
env:
GH_TOKEN: ${{ github.token }}
- name: Release
if: ${{ env.GitVersion_PreReleaseTag == '' }}
run: gh release create ${{ format('v{0}', env.GitVersion_SemVer) }} (get-item *.zip) --generate-notes --target ${{ github.sha }}
env:
GH_TOKEN: ${{ github.token }}