Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/code-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Code Scan

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC
workflow_dispatch:

permissions:
contents: read
security-events: write

Comment thread
1fabi0 marked this conversation as resolved.
jobs:
scan:
name: Trivy Code Scan
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@v0.35.0
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy results to GitHub Security
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: 'trivy-results.sarif'
category: 'Trivy'
56 changes: 56 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish

on:
workflow_call:
inputs:
version:
required: true
type: string
description: 'Version to publish (e.g., 1.0.0)'
notes:
required: true
type: string
description: 'Release notes for the NuGet package'

permissions:
contents: read

jobs:
publish:
name: Publish to NuGet
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
Comment thread
1fabi0 marked this conversation as resolved.
Outdated

- name: Build
run: |
dotnet build \
--configuration Release \
src/ShinyPDF/ShinyPDF.csproj \
/p:Version=${{ inputs.version }} \
/p:AssemblyVersion=${{ inputs.version }} \
/p:FileVersion=${{ inputs.version }} \
/p:InformationalVersion=${{ inputs.version }}

Comment thread
1fabi0 marked this conversation as resolved.
- name: Pack NuGet package
run: |
dotnet pack \
--configuration Release \
--output . \
src/ShinyPDF/ShinyPDF.csproj \
/p:Version=${{ inputs.version }} \
/p:PackageVersion=${{ inputs.version }} \
/p:AssemblyVersion=${{ inputs.version }} \
/p:FileVersion=${{ inputs.version }} \
/p:InformationalVersion=${{ inputs.version }} \
/p:PackageReleaseNotes="${{ inputs.notes }}"
Comment thread
1fabi0 marked this conversation as resolved.
Outdated

- name: Publish to NuGet
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
49 changes: 49 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Pull Request

on:
pull_request:
branches:
- main

permissions:
contents: read
checks: write
pull-requests: write

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
Comment thread
1fabi0 marked this conversation as resolved.
Outdated

- name: Restore dependencies
run: dotnet restore src/ShinyPDF.slnx

- name: Build
run: dotnet build src/ShinyPDF.slnx --configuration Release --no-restore
Comment thread
1fabi0 marked this conversation as resolved.

- name: Run unit tests
run: |
dotnet test \
src/ShinyPDF.UnitTests/ShinyPDF.UnitTests.csproj \
--configuration Release \
--no-build \
--verbosity normal \
--logger "trx;LogFileName=test-results.trx"

- name: Parse and comment test results
if: always()
uses: dorny/test-reporter@v3
with:
name: Unit Test Results
path: 'src/ShinyPDF.UnitTests/TestResults/test-results.trx'
reporter: 'dotnet-trx'
Comment thread
1fabi0 marked this conversation as resolved.
fail-on-error: false
Comment thread
1fabi0 marked this conversation as resolved.
Outdated
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
Comment thread
1fabi0 marked this conversation as resolved.

jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.changelog.outputs.version }}
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
skipped: ${{ steps.changelog.outputs.skipped }}

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Generate version from Conventional Commits
id: changelog
uses: TriPSs/conventional-changelog-action@v6
with:
fallback-version: 1.0.0


- name: Create GitHub release
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.version }}
body: ${{ steps.changelog.outputs.clean_changelog }}

publish:
name: Publish to NuGet
needs: release
if: ${{ needs.release.result == 'success' && needs.release.outputs.skipped == 'false' }}
uses: ./.github/workflows/publish.yaml
secrets: inherit
with:
version: ${{ needs.release.outputs.version }}
notes: ${{ needs.release.outputs.clean_changelog }}
35 changes: 0 additions & 35 deletions src/ShinyPDF/Resources/Description.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/ShinyPDF/Resources/PackageReadme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="../../../docs/img/logo.svg" height="25" /> ShinyPDF
# <img src="https://raw.githubusercontent.com/LM-Development/ShinyPDF/refs/heads/main/docs/img/logo.svg" height="25" /> ShinyPDF
Comment thread
1fabi0 marked this conversation as resolved.
Outdated

ShinyPDF is a modern open-source .NET library for PDF document generation. Offering comprehensive layout engine powered by concise and discoverable C# Fluent API. Shiny PDF is based on the latest fully open source version of [QuestPDF](https://github.com/QuestPDF/QuestPDF).

Expand Down
6 changes: 4 additions & 2 deletions src/ShinyPDF/ShinyPDF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
<Authors>LM Development</Authors>
<Company>LM IT Services AG</Company>
<PackageId>ShinyPDF</PackageId>
<PackageDescription>ShinyPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API. Easily generate PDF reports, invoices, exports, etc.</PackageDescription>
<PackageReadmeFile>./Resources/PackageReadme.md</PackageReadmeFile>
<PackageDescription>ShinyPDF is an open-source, modern library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API. Easily generate PDF reports, invoices, exports, etc.</PackageDescription>
<PackageIcon>./Resources/Logo.png</PackageIcon>
Comment thread
1fabi0 marked this conversation as resolved.
Outdated
<RepositoryUrl>https://github.com/LM-Development/ShinyPDF.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>LM IT Services AG, ShinyPDF contributors</Copyright>
<PackageTags>pdf report file export generate generation tool create creation render portable document format quest html library converter open source free standard core</PackageTags>
<PackageTags>pdf report file export generate generation tool create creation render portable document format shiny library converter open source free standard core</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Nullable>enable</Nullable>
<TargetFrameworks>net10.0</TargetFrameworks>
Expand Down
Loading