Couldn't publish 3 projects because of versionize

Viewed 16

I'm trying to publish 3 projects as a nuget package. The following GitHub workflow works fine publishing Project1, but it doesn't publish src/Project2/Project2.csproj and src/Project3/Project3.csproj.

I tried to create 3 files with the exact same code but for each one of the projects and there is a conflict in versionize. The first project is being published just fine but the rest of them fail because of the versions.

How can I make it work that way?

name: Publish

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
    - name: Setup .NET
      uses: actions/setup-dotnet@v2
      with:
        dotnet-version: 6.0.x
        source-url: https://nuget.pkg.github.com/Xnt/index.json
      env:
        NUGET_AUTH_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
    - name: Install dotnet tools
      run: dotnet tool install --global Versionize
    - name: Restore
      run: dotnet restore
    - name: Build
      run: dotnet build -c Release --no-restore
    - name: Setup git
      run: |
        git config --global user.name 'GitHub actions'
        git config --global user.email '...'
    - name: Version
      run: versionize
    - name: Push tags
      run: |
        git push --follow-tags
    - name: Pack
      run: dotnet pack --no-build -c Release -o . src/Project1/Project1.csproj
    - name: Publish
      run: dotnet nuget push *.nupkg
0 Answers
Related