v7.3.0 #137
Workflow file for this run
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: Build & Test Main | |
on: | |
push: | |
branches: [main] | |
release: | |
types: [published] | |
env: | |
NETCORE_VERSION: "8.0.x" | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
PROJECT_NAME: Modal | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NUGET_FEED: https://api.nuget.org/v3/index.json | |
NUGET_KEY: ${{ secrets.NUGET_KEY }} | |
jobs: | |
build: | |
name: Build, test and pack | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup .NET Core ${{ env.NETCORE_VERSION }} | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.NETCORE_VERSION }} | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Restore | |
run: dotnet restore | |
- name: Build Modal | |
run: dotnet build -c Release --no-restore src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.csproj | |
- name: Test | |
run: dotnet test -c Release --no-restore --verbosity normal | |
deploy: | |
needs: build | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.NETCORE_VERSION }} | |
- name: Create Release NuGet package | |
run: | | |
arrTag=(${GITHUB_REF//\// }) | |
VERSION="${arrTag[2]}" | |
echo Version: $VERSION | |
VERSION="${VERSION//v}" | |
echo Clean Version: $VERSION | |
dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/Blazored.$PROJECT_NAME/Blazored.$PROJECT_NAME.csproj | |
- name: Push to NuGet Feed | |
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --api-key $NUGET_KEY --skip-duplicate | |
docs: | |
name: Publish docs | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./docs | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
cache-dependency-path: './docs/package-lock.json' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build website | |
run: npm run build | |
# Popular action to deploy to GitHub Pages: | |
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# Build output to publish to the `gh-pages` branch: | |
publish_dir: ./docs/build | |
# The following lines assign commit authorship to the official | |
# GH-Actions bot for deploys to `gh-pages` branch: | |
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | |
# The GH actions bot is used by default if you didn't specify the two fields. | |
# You can swap them out with your own user credentials. | |
user_name: github-actions[bot] | |
user_email: 41898282+github-actions[bot]@users.noreply.github.com |