Merge pull request #1195 from hflexgrig/devel #429
This file contains 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, 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: ./build.sh | |
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: | | |
if ($env:GITHUB_REF -eq "refs/heads/main") { | |
.\build.ps1 -Target Publish | |
} elseif ($env:GITHUB_REF -eq "refs/heads/devel") { | |
.\build.ps1 -Target PrePublish | |
} else { | |
.\build.ps1 | |
} |