Add support for SSH authentication using libssh2 #33
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master, release-*] | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+.[0-9]+-*" | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| RID: ${{ matrix.name }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-2022 | |
| name: win-x86 | |
| param: -x86 | |
| - os: windows-2022 | |
| name: win-x64 | |
| param: -x64 | |
| - os: windows-2022 | |
| name: win-arm64 | |
| param: -arm64 | |
| - os: ubuntu-24.04 | |
| name: linux-x64 | |
| - os: ubuntu-24.04 | |
| name: linux-arm | |
| - os: ubuntu-24.04 | |
| name: linux-arm64 | |
| - os: ubuntu-24.04 | |
| name: linux-ppc64le | |
| - os: ubuntu-24.04 | |
| name: linux-musl-x64 | |
| - os: ubuntu-24.04 | |
| name: linux-musl-arm | |
| - os: ubuntu-24.04 | |
| name: linux-musl-arm64 | |
| - os: macos-26-intel | |
| name: osx-x64 | |
| - os: macos-26 | |
| name: osx-arm64 | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| submodules: true | |
| - name: Build Windows | |
| if: runner.os == 'Windows' | |
| run: ./build.libgit2.ps1 ${{ matrix.param }} | |
| - name: Build macOS | |
| if: runner.os == 'macOS' | |
| run: ./build.libgit2.sh | |
| - name: Setup QEMU | |
| if: runner.os == 'Linux' && (matrix.name == 'linux-arm' || matrix.name == 'linux-arm64' || matrix.name == 'linux-ppc64le' || matrix.name == 'linux-musl-arm' || matrix.name == 'linux-musl-arm64') | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build Linux | |
| if: runner.os == 'Linux' | |
| run: ./dockerbuild.sh | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: nuget.package/runtimes/${{ matrix.name }} | |
| package: | |
| name: Create package | |
| needs: build | |
| runs-on: ubuntu-24.04 | |
| env: | |
| DOTNET_NOLOGO: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v5.2.0 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Compute version suffix for branch builds | |
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| id: version | |
| run: | | |
| # Sanitize branch name: lowercase, replace non-alphanumeric with hyphen, trim to 20 chars | |
| BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" | |
| SAFE_BRANCH=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//' | sed 's/-$//' | cut -c1-20) | |
| echo "override=${SAFE_BRANCH}.${{ github.run_number }}" >> "$GITHUB_OUTPUT" | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| path: nuget.package/runtimes/ | |
| - name: Create package | |
| run: dotnet pack nuget.package ${{ steps.version.outputs.override && format('/p:MinVerDefaultPreReleaseIdentifiers="{0}"', steps.version.outputs.override) || '' }} | |
| - name: Upload NuGet package | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| name: NuGet package | |
| path: ./nuget.package/*.nupkg | |
| - name: Push package to feed | |
| shell: bash | |
| env: | |
| FEED_API_KEY: ${{ secrets.FEED_API_KEY }} | |
| FEED_SOURCE: ${{ secrets.FEED_SOURCE }} | |
| run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" | |
| ci: | |
| name: ci | |
| needs: [build, package] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check results | |
| run: | | |
| if [ "${{ needs.build.result }}" != "success" ] || [ "${{ needs.package.result }}" != "success" ]; then | |
| echo "One or more jobs failed" | |
| exit 1 | |
| fi |