Merge pull request #7 from MeltyObserver/patch-1 #4
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
# Taken from LibreHardwareMonitor https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/blob/master/.github/workflows/main.yml | |
name: CI | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-2022 | |
if: contains(github.event.head_commit.message, 'ci skip') == false | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: microsoft/setup-msbuild@v1.1 | |
with: | |
msbuild-architecture: x64 | |
- uses: nuget/setup-nuget@v1 | |
with: | |
nuget-version: 'latest' | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
buildprops: | |
- 'Directory.Build.props' | |
- name: Update version | |
if: steps.changes.outputs.buildprops == 'false' | |
run: | | |
(Get-Content Directory.Build.props) | % { | |
$m = [regex]::match($_, '<Version>(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?</Version>'); | |
if(!$m.Success -or $m.Groups[4].Success -or $m.Groups[5].Success) { $_; } | |
else { $_ -replace $m.Value, ("<Version>{0}.{1}.{2}-prerelease${{ github.run_number }}</Version>" -f $m.Groups[1].Value,$m.Groups[2].Value,([convert]::ToInt32($m.Groups[3].Value)+1)); } | |
} | Set-Content Directory.Build.props | |
- name: NuGet restore | |
run: nuget restore DXNET.sln | |
- name: Build | |
run: msbuild DXNET.sln -p:Configuration=Release -m | |
- name: Publish nupkg | |
uses: actions/upload-artifact@v2 | |
with: | |
name: DXNET-NUPKG | |
path: | | |
Output/Release/DXNET.*.nupkg | |
# - name: Upload update to NuGet | |
# uses: rohith/publish-nuget@v2 | |
# with: | |
# PROJECT_FILE_PATH: DXNET/DXNET.csproj | |
# VERSION_FILE_PATH: Directory.Build.props | |
# NUGET_KEY: ${{secrets.NUGET_API_KEY}} | |
# INCLUDE_SYMBOLS: false | |
# TAG_COMMIT: false |