Skip to content

Unhandled exception is thrown when using in a Github pipeline #24

@cdavernas

Description

@cdavernas

Describe the bug
Unhandled exception is thrown when running a Github pipeline with Versioning.NET

Unhandled exception. System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'git2-106a5f2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-106a5f2: cannot open shared object file: No such file or directory

To Reproduce
Steps to reproduce the behavior:

  1. Got to Github
  2. Create a new pipeline
  3. Try running Versioning.NET on your project, as described in the wiki

Expected behavior
Everything should work correctly, and new version is computed as expected

Additional information

The pipeline that fails:

name: CI

on:

  push:
    branches: [ main ]
    
  pull_request:
    branches: [ main ]
    
  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Configure remote repository
        run: |
          apt-get update
          apt-get install -y libgit2-dev
          git remote set-url origin "https://username:[email protected]/myrepo/repo.git"
          dotnet tool install --global Versioning.NET
          dotnet-version increment-version-with-git -g "." --branch-name main --author-email [email protected]

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions