This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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:GitVersion_NoFetchEnabled=true | |
- 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' | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: r${{ env.GitVersion_AssemblySemVersion }} | |
release_name: Release ${{ env.GitVersion_AssemblySemVersion }} | |
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 | |
... |