Skip to content

Update nuget_windows.yml #33

Update nuget_windows.yml

Update nuget_windows.yml #33

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:
deploy:
name: 'Deploy'
runs-on: windows-2019
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: Setup .Net
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.x.x
6.x.x
5.x.x
3.x.x
- name: Get version
id: version
uses: battila7/get-version-action@v2
- name: Check version
run: echo ${{ steps.version.outputs.version-without-v }}
- name: Set project version
run: |
dotnet tool install -g dotnet-setversion
setversion ${{ steps.version.outputs.version-without-v }} ${{ env.PATH_TO_PROJECTS }}\Asv.Gnss\Asv.Gnss.csproj
setversion ${{ steps.version.outputs.version-without-v }} ${{ env.PATH_TO_PROJECTS }}\Asv.Gnss.Prometheus\Asv.Gnss.Prometheus.csproj
- name: Restore dependencies
run: |
cd src
dotnet restore
- name: Build projects
run: |
cd src
dotnet build -c Release --no-restore
- name: Running all tests
run: |
cd src
dotnet test --no-restore --verbosity normal
- name: Pack projects to Nuget
run: |
cd src
dotnet pack -c Release --no-build --no-restore -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Push package to Nuget
run: |
cd src
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Gnss.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Gnss.Prometheus.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}
# - name: Push package to github packages
# run: |
# cd src
# dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Gnss.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} -s ${{ env.GITHUB_PACKAGES_URL }}
# dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Gnss.Prometheus.${{ steps.version.outputs.version-without-v }}.nupkg -k ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} -s ${{ env.GITHUB_PACKAGES_URL }}