Skip to content

Merge pull request #17 #11

Merge pull request #17

Merge pull request #17 #11

Workflow file for this run

name: Deploy Nuget for Windows
on:
push:
tags:
- 'v*'
env:
PATH_TO_PROJECTS: ${{ github.workspace }}\src
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output\
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
GITHUB_PACKAGES_URL: 'https://nuget.pkg.github.com/asv-soft/index.json'
jobs:
publish:
name: 'Publish'
runs-on: windows-2019
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.x.x
7.x.x
6.x.x
5.x.x
3.x.x
- name: Set version variable
env:
TAG: ${{ github.ref_name }}
shell: pwsh
run: |
$newTag = $env:TAG -replace "v", ""
echo "VERSION=$newTag" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Restore dependencies
run: |
cd src
dotnet restore
- name: Build project
run: |
cd src
dotnet build --configuration Release --no-restore
- name: Pack project
run: |
cd src
dotnet pack -c Release --no-build --no-restore -p:PackageVersion=${{ env.VERSION }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Publish to GitHub Packages
run: |
cd src
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Avalonia.Map.${{ env.VERSION }}.nupkg -k ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} --skip-duplicate -s ${{ env.GITHUB_PACKAGES_URL }}
- name: Pushing packages to Nuget
run: |
cd src
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Avalonia.Map.${{ env.VERSION }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}