Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 40 additions & 0 deletions .github/workflows/code-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: 'trivy-results.sarif'
category: 'Trivy'
82 changes: 82 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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
id-token: write

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:
global-json-file: src/global.json

- 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: Write package release notes file
env:
PACKAGE_RELEASE_NOTES_RAW: ${{ inputs.notes }}
run: |
printf '%s' "$PACKAGE_RELEASE_NOTES_RAW" > "$RUNNER_TEMP/release-notes.txt"

- name: Pack NuGet package
run: |
dotnet pack \
--configuration Release \
--no-build \
--no-restore \
--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:PackageReleaseNotesFile="$RUNNER_TEMP/release-notes.txt"

- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}

- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
run: |
dotnet nuget push "*.nupkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate

dotnet nuget push "*.snupkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
50 changes: 50 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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:
global-json-file: src/global.json

- 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 \
--results-directory src/ShinyPDF.UnitTests/TestResults \
--verbosity normal \
--logger "trx;LogFileName=test-results.trx"

- name: Parse and report test results
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository }}
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
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

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

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/main/docs/img/logo.svg" height="25" /> ShinyPDF

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
7 changes: 5 additions & 2 deletions src/ShinyPDF/ShinyPDF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
<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>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>Logo.png</PackageIcon>
<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>
<PackageReleaseNotes Condition="'$(PackageReleaseNotesFile)' != '' and Exists('$(PackageReleaseNotesFile)')">$([System.IO.File]::ReadAllText('$(PackageReleaseNotesFile)'))</PackageReleaseNotes>
<Nullable>enable</Nullable>
<TargetFrameworks>net10.0</TargetFrameworks>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
2 changes: 1 addition & 1 deletion src/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"sdk": {
"version": "10.0.201",
"rollForward": "latestMinor",
"allowPrerelease": true
"allowPrerelease": false
}
}
Loading