Skip to content

Merge pull request #5 from tilde-nlp/fix/option_validation #83

Merge pull request #5 from tilde-nlp/fix/option_validation

Merge pull request #5 from tilde-nlp/fix/option_validation #83

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: ["main", "initial"]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Update build version
run: |
$PROJECT_FILE=".\Tilde.Translation\Tilde.Translation.csproj"
$BUILD_NUMBER="${{github.run_number}}"
echo "Build number: $BUILD_NUMBER"
(Get-Content -Path $PROJECT_FILE) -replace "(?<=<Version>)(\d+\.\d+\.\d+\.)(\d+)(?=</Version>)", "`${1}$BUILD_NUMBER" | Set-Content -Path $PROJECT_FILE
# TMP output
cat $PROJECT_FILE
- name: Restore dependencies
run: dotnet restore .\Tilde.Translation\Tilde.Translation.csproj
- name: Build app for release
run: |
msbuild Tilde.Translation\Tilde.Translation.csproj -t:rebuild -property:Configuration=Release
$packages = gci -r -fi *.nupkg
echo "Found packages: $packages"
foreach ($package in $packages)
{
Write-Host "Removing package: $package"
Remove-Item $package.FullName
}
msbuild Tilde.Translation\Tilde.Translation.csproj -t:rebuild -property:Configuration=Release
- name: Publish to private nuget repo
run: |
cat ".\Tilde.Translation\Tilde.Translation.csproj"
gci -r -fi *.nupkg
$NUGET_PACKAGE_PATH=gci -r -fi *.nupkg | % { $_.FullName }
echo "Nuget package path: $NUGET_PACKAGE_PATH"
dotnet nuget push $NUGET_PACKAGE_PATH --api-key ${{ secrets.NUGET_PAT }} --source https://api.nuget.org/v3/index.json --skip-duplicate