Bump the dependencies group in /src with 5 updates #218
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 | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
profile: | |
- publishProfile: "Release.pubxml" | |
artifactName: "nomad_iis" | |
- publishProfile: "ReleaseWithMgmtApi.pubxml" | |
artifactName: "nomad_iis_mgmt_api" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
# Extract and publish version | |
- name: extract version | |
run: | | |
Get-Content "./src/NomadIIS/PluginInfo.cs" | Select-String 'public static readonly string Version = "([0-9]+\.[0-9]+\.[0-9])";' | ForEach-Object { | |
$version = $_.Matches[0].Groups[1].Value | |
} | |
$version | Out-File -Path version -NoNewline | |
- name: Upload version | |
if: ${{ matrix.profile.artifactName == 'nomad_iis' }} # We only need to do this once | |
uses: actions/upload-artifact@v4 | |
with: | |
name: version | |
path: ./version | |
# Publish the application | |
- name: Publish the application | |
run: dotnet publish "./src/NomadIIS/NomadIIS.csproj" /p:PublishProfile="./src/NomadIIS/Properties/PublishProfiles/${{ matrix.profile.publishProfile }}" | |
# Copy to output | |
- name: Copy to output folder | |
run: | | |
mkdir dist | |
copy .\src\NomadIIS\bin\Release\net8.0\win-x64\publish\nomad_iis.exe .\dist\nomad_iis.exe | |
# Upload the artifact | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.profile.artifactName }} | |
path: ./dist |