remove set-output by switching to new gh commands #18
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 | |
echo "MajorMinor VERSION: ${{ env.GitVersion_MajorMinor }}" | |
- name: Build GW Launcher | |
run: | | |
echo "MajorMinor VERSION: ${{ env.GitVersion_MajorMinor }}" | |
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' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "r${{ env.GitVersion_MajorMinor }}" ` | |
--title "Release ${{ env.GitVersion_MajorMinor }}" ` | |
--notes "Release ${{ env.GitVersion_MajorMinor }}" ` | |
./Publish/GW_Launcher.exe |