Skip to content

Merge pull request #182 from PinguApps/renovate/verify.xunit-28.x #134

Merge pull request #182 from PinguApps/renovate/verify.xunit-28.x

Merge pull request #182 from PinguApps/renovate/verify.xunit-28.x #134

Workflow file for this run

name: Main
on:
push:
branches: [ main ]
release:
types: [ published ]
workflow_dispatch:
env:
PROJECT_NAME: PinguApps.Blazor.QRCode
DOTNET_VERSION: '9.0'
BASE_HREF: 'Blazor.QRCode'
BRANCH: 'main'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_FEED: https://api.nuget.org/v3/index.json
NUGET_KEY: ${{ secrets.NUGET_KEY }}
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore src/$PROJECT_NAME/$PROJECT_NAME.csproj
- name: Test
run: dotnet test -c Release --no-restore --verbosity normal tests/$PROJECT_NAME.Tests/
deploy:
needs: build
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Publish
run: dotnet publish -c Release src/BlazorWasmNet6/BlazorWasmNet6.csproj
- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@5b54862a8831e012d4f1a8b2660894415fdde8ec # v1
with:
html_path: src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/index.html
base_href: /${{ env.BASE_HREF }}/
- name: copy index.html to 404.html
run: cp src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/index.html src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/404.html
- name: Add .nojekyll file
run: touch src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot/.nojekyll
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/github-pages-deploy-action@15de0f09300eea763baee31dff6c6184995c5f6a # v4
with:
branch: gh-pages
folder: src/BlazorWasmNet6/bin/Release/net6.0/publish/wwwroot
push-nuget:
needs: build
if: github.event_name == 'release'
name: Push Nuget
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Create Nuget Package
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
echo Version: $VERSION
VERSION="${VERSION:1}"
echo Clean Version: $VERSION
dotnet pack -c Release --verbosity normal --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME.csproj
- name: Push to NuGet Feed
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --api-key $NUGET_KEY --skip-duplicate