Skip to content

feat(mavlink): update product version #13

feat(mavlink): update product version

feat(mavlink): update product version #13

name: Github only deploy nuget on windows with no tests
on:
push:
tags:
- "dev-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: |
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 "dev-v", ""
$newTag += "-dev"
echo "VERSION=$newTag" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Checking version
run: echo ${{ env.VERSION }}
- name: Setting the project version
run: |
dotnet tool install -g dotnet-setversion
setversion ${{ env.VERSION }} ${{ env.PATH_TO_PROJECTS }}\Asv.Mavlink\Asv.Mavlink.csproj
- name: Restoring dependencies
run: |
cd src
dotnet restore
- name: Building projects
run: |
cd src
dotnet build -c Release --no-restore
- name: Packing projects to Nuget
run: |
cd src
dotnet pack -c Release --no-build --no-restore -p:PackageVersion=${{ env.VERSION }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Pushing packages to Github
run: |
cd src
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}Asv.Mavlink.${{ env.VERSION }}.nupkg -k ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} --skip-duplicate -s ${{ env.GITHUB_PACKAGES_URL }}