Skip to content

Set version to '4.10' #237

Set version to '4.10'

Set version to '4.10' #237

Workflow file for this run

name: publish
on:
push:
branches:
- 'releases/**'
jobs:
build:
name: build, pack, publish, and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- uses: dotnet/[email protected]
id: nbgv
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
# Semantic version range syntax or exact version of a dotnet version
dotnet-version: '9.0.x'
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: dotnet restore
working-directory: ./src
- name: npm ci
run: npm ci
working-directory: ./src/assets
- name: Build
run: dotnet build --configuration Release -p:Version=${{ steps.nbgv.outputs.Version }} --no-restore --nologo
working-directory: ./src
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
working-directory: ./src
- uses: mukunku/[email protected]
id: checkTag
with:
tag: 'v${{ steps.nbgv.outputs.Version }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Pack
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true'
run: dotnet pack ./Tavenem.Blazor.Framework.csproj --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=${{ steps.nbgv.outputs.Version }} --configuration Release --no-build --nologo --output .
working-directory: ./src
- name: Push to NuGet
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true'
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
working-directory: ./src
- name: Publish
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true' && steps.nbgv.outputs.PrereleaseVersion == ''
run: dotnet publish --configuration Release -o publish -p:Version=${{ steps.nbgv.outputs.Version }} --no-build --nologo
working-directory: ./docs/docsite
# copy index.html to 404.html to fix GitHub Pages SPA navigation
- name: copy index.html to 404.html
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true' && steps.nbgv.outputs.PrereleaseVersion == ''
run: |
cp index.html 404.html
working-directory: ./docs/docsite/publish/wwwroot
# add .nojekyll file so GitHub pages will not treat this as a Jekyll project
- name: Add .nojekyll file
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true' && steps.nbgv.outputs.PrereleaseVersion == ''
run: touch publish/wwwroot/.nojekyll
working-directory: ./docs/docsite
- name: Deploy
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true' && steps.nbgv.outputs.PrereleaseVersion == ''
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/docsite/publish/wwwroot
- name: Git tag
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true'
run: git tag v${{ steps.nbgv.outputs.Version }}
- name: Push tag
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true'
run: git push origin v${{ steps.nbgv.outputs.Version }}
- name: Release
if: steps.nbgv.outputs.PublicRelease && steps.checkTag.outputs.exists != 'true'
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.nbgv.outputs.Version }}
name: Release v${{ steps.nbgv.outputs.Version }}
draft: false
prerelease: ${{ steps.nbgv.outputs.PrereleaseVersion != '' }}
body: See [changelog](docs/CHANGELOG.md)