Skip to content

Commit

Permalink
Auto-builds use microsoft/setup-msbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
TomRichter committed Feb 19, 2022
1 parent 327ad33 commit f3e2017
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: "Build"
on:
push:
tags:
tags:
- "*"

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "windows-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Process Version from Tag"
id: "semver"
uses: "ncipollo/semantic-version-action@v1"

- name: "Set Version with Build Number"
id: "version"
env:
Expand All @@ -25,14 +25,14 @@ jobs:
run: |
echo "::set-output name=number::${Env:BUILD_VERSION}.${Env:GITHUB_RUN_NUMBER}"
echo "::set-output name=hash::$($Env:GITHUB_SHA.Substring(0, 7))"
- name: "Update Version in AssemblyInfo.cs"
env:
BUILD_VERSION: "${{ steps.version.outputs.number }}"
shell: "powershell"
run: |
.\.github\workflows\UpdateAssemblyInfo.ps1
- name: "Write Version to Text File"
env:
BUILD_VERSION: "${{ steps.version.outputs.number }}"
Expand All @@ -42,10 +42,13 @@ jobs:
echo "version: ${Env:BUILD_VERSION}" >> "${Env:GITHUB_WORKSPACE}\VERSION.md"
echo "commit: ${Env:GITHUB_SHA}" >> "${Env:GITHUB_WORKSPACE}\VERSION.md"
echo "date: $((Get-Date -format r).ToString())" >> "${Env:GITHUB_WORKSPACE}\VERSION.md"
- name: "Add MSBuild to PATH"
uses: "microsoft/[email protected]"

- name: "Install NuGet"
uses: "nuget/setup-nuget@v1"

- name: "Configure NuGet Sources"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Expand All @@ -66,12 +69,10 @@ jobs:
run: |
nuget restore -LockedMode ${Env:GITHUB_WORKSPACE}
- name: "Build with .NET Framework 3.5"
shell: "powershell"
- name: "Build with .NET Framework"
run: |
cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe "${Env:GITHUB_WORKSPACE}\" /p:RestoreLockedMode=true /p:Configuration=Release
msbuild "${Env:GITHUB_WORKSPACE}" -p:RestoreLockedMode=true -p:Configuration=Release
- name: "Package Artifacts"
env:
BUILD_VERSION: "${{ steps.version.outputs.number }}"
Expand All @@ -80,7 +81,7 @@ jobs:
run: |
7z a PulsarModLoaderInstaller-${Env:BUILD_VERSION}-${Env:COMMIT_HASH}.zip README.md VERSION.md .\lib\System.Windows.Forms.dll .\PulsarInjector\bin\Release\* -xr!'*.pdb' -mx=7
7z a PulsarModLoader.dll-${Env:BUILD_VERSION}-${Env:COMMIT_HASH}.zip README.md VERSION.md .\PulsarModLoader\bin\Release\PulsarModLoader.dll -mx=7
- name: "Publish to GitHub Releases"
uses: "marvinpinto/action-automatic-releases@latest"
with:
Expand All @@ -89,7 +90,7 @@ jobs:
title: "PML v${{ steps.version.outputs.number }}"
files: |
*.zip
- name: "NuGet Pack and Push"
shell: "powershell"
run: |
Expand Down

0 comments on commit f3e2017

Please sign in to comment.