Try to install libssl for mono tests #94
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: dotnet | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: ["*"] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '3.1.x' | |
| - uses: gittools/actions/gitversion/setup@v0.9.7 | |
| with: | |
| versionSpec: "5.x" | |
| - id: gitversion | |
| uses: gittools/actions/gitversion/execute@v0.9.7 | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Install Mono (Linux only) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| # Install mono and common OpenSSL packages. Some test hosts need libssl1.1, others libssl3. | |
| sudo apt-get install -y --no-install-recommends mono-devel libssl-dev libssl3 || true | |
| # Try installing libssl1.1 if available (older runners/packages may require it). Ignore errors. | |
| sudo apt-get install -y --no-install-recommends libssl1.1 || true | |
| # Verify installation | |
| mono --version || true | |
| ldconfig -p | grep libssl || true | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Test | |
| run: dotnet test --configuration Release --no-build --verbosity normal | |
| - run: | | |
| dotnet pack \ | |
| --include-source \ | |
| --include-symbols \ | |
| --configuration Release \ | |
| --no-build \ | |
| --no-restore \ | |
| -p:PackageVersion="${{ env.GitVersion_FullSemVer }}" \ | |
| RegExtract/RegExtract.csproj \ | |
| --output ${{ github.workspace }}/nugets/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: nugets | |
| path: nugets | |
| nuget-push-dev: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| needs: build | |
| steps: | |
| - name: download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nugets | |
| - name: setup dotnet | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| source-url: https://nuget.pkg.github.com/sblom/index.json | |
| env: | |
| NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: nuget push | |
| run: dotnet nuget push *.nupkg *.snupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} | |
| nuget-push-prod: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: nugets | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| source-url: https://api.nuget.org/v3/index.json | |
| env: | |
| NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - run: dotnet nuget push *.nupkg *.snupkg --skip-duplicate |