Skip to content

Upgrade build system to Nuke following AngleSharp ecosystem standards #112

Upgrade build system to Nuke following AngleSharp ecosystem standards

Upgrade build system to Nuke following AngleSharp ecosystem standards #112

Workflow file for this run

name: CI
on: [push, pull_request]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
DOCS_PATH: ${{ secrets.DOCS_PATH }}
DOCS_BRANCH: ${{ secrets.DOCS_BRANCH }}
jobs:
can_document:
runs-on: ubuntu-latest
outputs:
value: ${{ steps.check_job.outputs.value }}
steps:
- name: Checks whether documentation can be built
id: check_job
run: |
echo "value: ${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
echo "value=${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}" >> "${GITHUB_OUTPUT}"
documentation:
needs: [can_document]
runs-on: ubuntu-latest
if: needs.can_document.outputs.value == 'true'
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "14.x"
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: |
cd $DOCS_PATH
npm install
- name: Deploy Doclet
run: |
cd $DOCS_PATH
npx pilet publish --fresh --url https://feed.piral.cloud/api/v1/pilet/anglesharp --api-key ${{ secrets.PIRAL_FEED_KEY }}
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build
run: dotnet build src/AngleSharp.Diffing.sln --configuration Release
- name: Test
run: dotnet test src/AngleSharp.Diffing.sln --configuration Release --no-build
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build
run: dotnet build src/AngleSharp.Diffing.sln --configuration Release
- name: Test
run: dotnet test src/AngleSharp.Diffing.sln --configuration Release --no-build
- name: Publish to NuGet
if: github.ref == 'refs/heads/main'
run: |
if ($env:NUGET_API_KEY) {
dotnet pack src/AngleSharp.Diffing.sln --configuration Release --no-build --output nupkgs
dotnet nuget push "nupkgs/*.nupkg" --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
}