Skip to content

feat: add tenant context and context accessor (#117) #455

feat: add tenant context and context accessor (#117)

feat: add tenant context and context accessor (#117) #455

Workflow file for this run

name: ci
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
env:
NUGET_PACKAGES: '${{ github.workspace }}/.nuget/packages'
jobs:
build-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: NuGet Cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: |
${{ env.NUGET_PACKAGES }}
.nuke/temp
key: ${{ runner.os }}-nuget-${{ hashFiles('**/global.json', '**/*.csproj', '**/*.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
- name: Restore .NET Tools
run: |
dotnet tool restore
- name: Build, Test and Pack
run: |
dotnet nuke
- name: Upload Coverage
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
directory: ${{ github.workspace }}/artifacts/coverage
files: "*.cobertura.xml"
- name: Upload Packages
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: packages
path: ${{ github.workspace }}/artifacts/packages
if-no-files-found: error
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: NPM Cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 'lts/iron'
- name: NuGet Cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: |
${{ env.NUGET_PACKAGES }}
.nuke/temp
key: ${{ runner.os }}-nuget-${{ hashFiles('**/global.json', '**/*.csproj', '**/*.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
- name: Restore .NET Tools
run: |
dotnet tool restore
- name: Build Docs
run: |
dotnet nuke Docs
- name: Upload Docs
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: ${{ github.workspace }}/artifacts/docs
publish-packages:
runs-on: ubuntu-latest
needs: [build-packages]
# Only publish if build was triggered for a tag
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Download Packages
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: packages
path: ${{ github.workspace }}/artifacts/packages
- name: Setup .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
- name: Restore .NET Tools
run: |
dotnet tool restore
- name: Publish NuGet packages
run: |
dotnet nuke Publish \
--nuget-api-key $NUGET_API_KEY
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
publish-docs:
runs-on: ubuntu-latest
needs: [build-docs]
# Only publish if build was triggered for a tag
if: startsWith(github.ref, 'refs/tags/v')
permissions:
pages: write # to deploy to pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
id: deployment