Reformat, update dependencies #9
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: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Extract version number | |
id: extract_version | |
shell: pwsh | |
run: | | |
[xml]$csproj = Get-Content CmodConvert\CmodConvert.csproj | |
Add-Content -Path "$env:GITHUB_OUTPUT" ` | |
-Value "version=$($csproj.Project.PropertyGroup.Version)" | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c Release --no-restore | |
- name: Test | |
run: dotnet test -c Release --no-restore --no-build | |
- name: Package | |
run: | | |
dotnet publish CmodConvert ` | |
-c Release ` | |
-o Publish ` | |
--no-restore ` | |
--no-build ` | |
--sc false | |
# Remove the platform-specific .exe file before publishing | |
rm Publish\CmodConvert.exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
if: success() | |
with: | |
name: cmodconvert-${{ steps.extract_version.outputs.version }} | |
path: Publish/ | |