Skip to content

Workflow file for this run

---
name: Build and Release
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: .NET Tool Restore
run: dotnet tool restore
- name: GitVersion
run: dotnet dotnet-gitversion /output buildserver
- name: Build GW Launcher
run: |
MSBuild.exe "GW Launcher\GW Launcher.csproj" `
/target:"Restore;Publish" `
/m /nodeReuse:false `
/property:"PublishProfile=SelfContained" `
/property:"Version=${env:GitVersion_MajorMinor}" `
/property:"NuGetVersion=${env:GitVersion_NuGetVersion}" `
/property:"AssemblyVersion=${env:GitVersion_AssemblySemVer}"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: GW Launcher
path: "Publish\\GW_Launcher.exe"
if-no-files-found: error
- name: Create Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: r${{ steps.gitversion.outputs.version }}
release_name: Release ${{ steps.gitversion.outputs.version }}
draft: false
prerelease: false
- name: Upload Release Asset
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Publish/GW_Launcher.exe
asset_name: GW_Launcher.exe
asset_content_type: application/octet-stream
...