✅ Github actions deploy doesnt increment versions

I have this Actions workflow file
name: Publish NuGet Package

on:
  push:
    branches:
      - dev

jobs:
  publish:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
      
    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '7.x'
        
    - name: Restore dependencies
      run: dotnet restore
      
    - name: Build
      run: dotnet build --configuration Release
      
    - name: Determine version
      id: version
      run: echo "::set-output name=version::0.$((${GITHUB_RUN_NUMBER} / 100)).$((${GITHUB_RUN_NUMBER} % 100))"
      
    - name: Pack
      run: dotnet pack --configuration Release --version-suffix "-dev${{ steps.version.outputs.version }}" --output nupkgs
      
    - name: Publish to NuGet
      run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

Which is supposed to push a dev version package to NuGet everytime my dev branch being merged into from a feature branch, and its supposed to auto attach a dev version

for example if my package version is 1.5.2 its supposed to attach 1.5.2-Dev0.0.1, 0.0.2, 0.0.3 and so on
But this configuration just pushes version 1.5.2 which would be a release
Was this page helpful?