Skip to content

Commit adec031

Browse files
committed
1.0
0 parents  commit adec031

36 files changed

Lines changed: 3800 additions & 0 deletions
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Docker Publish
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'Dockerfile'
8+
- 'CreatePdf.NET/**'
9+
- '.github/workflows/docker-publish.yml'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Log in to Docker Hub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKER_USERNAME }}
27+
password: ${{ secrets.DOCKER_PASSWORD }}
28+
29+
- name: Extract metadata
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: ${{ secrets.DOCKER_USERNAME }}/createpdf-net
34+
tags: |
35+
type=ref,event=branch
36+
type=sha,prefix={{branch}}-
37+
type=raw,value=preview-10.0
38+
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}
46+
cache-from: type=gha
47+
cache-to: type=gha,mode=max
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: NuGet Publish
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- '**.cs'
8+
- '**.csproj'
9+
- '.github/workflows/nuget-publish.yml'
10+
release:
11+
types: [ published ]
12+
workflow_dispatch:
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup .NET 10 Preview
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '10.0.x'
26+
27+
- name: Restore dependencies
28+
run: dotnet restore
29+
30+
- name: Build solution
31+
run: dotnet build --configuration Release --no-restore
32+
33+
- name: Run tests
34+
run: dotnet test --configuration Release --no-build --verbosity normal
35+
36+
- name: Pack NuGet package
37+
run: dotnet pack CreatePdf.NET/CreatePdf.NET.csproj --configuration Release --no-build --output ./nupkg
38+
39+
- name: Publish packages to NuGet.org
40+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
41+
run: |
42+
dotnet nuget push ./nupkg/*.nupkg \
43+
--api-key ${{ secrets.NUGET_API_KEY }} \
44+
--source https://api.nuget.org/v3/index.json \
45+
--skip-duplicate
46+
47+
dotnet nuget push ./nupkg/*.snupkg \
48+
--api-key ${{ secrets.NUGET_API_KEY }} \
49+
--source https://api.nuget.org/v3/index.json \
50+
--skip-duplicate

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests and Coverage
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup .NET 10 Preview
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: '10.0.x'
21+
22+
- name: Restore dependencies
23+
run: dotnet restore
24+
25+
- name: Build
26+
run: dotnet build --no-restore --configuration Release
27+
28+
- name: Run tests with coverage
29+
run: |
30+
dotnet test --no-build --configuration Release \
31+
--collect:"XPlat Code Coverage" \
32+
--logger:"console;verbosity=detailed"
33+
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v5
36+
with:
37+
token: ${{ secrets.CODECOV_TOKEN }}
38+
files: ./**/coverage.cobertura.xml
39+
fail_ci_if_error: false

.gitignore

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
[Dd]ebug/
2+
[Dd]ebugPublic/
3+
[Rr]elease/
4+
[Rr]eleases/
5+
x64/
6+
x86/
7+
[Ww][Ii][Nn]32/
8+
[Aa][Rr][Mm]/
9+
[Aa][Rr][Mm]64/
10+
bld/
11+
[Bb]in/
12+
[Oo]bj/
13+
[Ll]og/
14+
[Ll]ogs/
15+
16+
.vs/
17+
.idea/
18+
.vscode/
19+
20+
*.rsuser
21+
*.suo
22+
*.user
23+
*.userosscache
24+
*.sln.docstates
25+
26+
*.nupkg
27+
*.snupkg
28+
!NuGet.exe
29+
*.nuget.props
30+
*.nuget.targets
31+
**/packages/*
32+
!**/packages/build/
33+
34+
*.binlog
35+
36+
project.lock.json
37+
project.fragment.lock.json
38+
artifacts/
39+
40+
*.pdb
41+
*.ipdb
42+
*.pgc
43+
*.pgd
44+
*.rsp
45+
*.sbr
46+
*.tlb
47+
*.tli
48+
*.tlh
49+
*.tmp
50+
*.tmp_proj
51+
*_i.c
52+
*_p.c
53+
*_h.h
54+
*.ilk
55+
*.meta
56+
*.obj
57+
*.iobj
58+
*.pch
59+
*.ipch
60+
*.opensdf
61+
*.sdf
62+
*.cachefile
63+
*.VC.db
64+
*.VC.VC.opendb
65+
66+
*.psess
67+
*.vsp
68+
*.vspx
69+
*.sap
70+
71+
_ReSharper*/
72+
*.[Rr]e[Ss]harper
73+
*.DotSettings.user
74+
75+
_TeamCity*
76+
77+
*.dotCover
78+
79+
_NCrunch_*
80+
.*crunch*.local.xml
81+
nCrunchTemp_*
82+
83+
DocProject/buildhelp/
84+
DocProject/Help/*.HxT
85+
DocProject/Help/*.HxC
86+
DocProject/Help/*.hhc
87+
DocProject/Help/*.hhk
88+
DocProject/Help/*.hhp
89+
DocProject/Help/Html2
90+
DocProject/Help/html
91+
92+
*.[Pp]ublish.xml
93+
*.azurePubxml
94+
*.pubxml
95+
*.publishproj
96+
97+
PublishScripts/
98+
99+
PublishProfiles/
100+
101+
*.Cache
102+
ClientBin/
103+
~$*
104+
*~
105+
*.dbmdl
106+
*.dbproj.schemaview
107+
*.jfm
108+
*.pfx
109+
*.publishsettings
110+
111+
_UpgradeReport_Files/
112+
Backup*/
113+
UpgradeLog*.XML
114+
UpgradeLog*.htm
115+
116+
*.mdf
117+
*.ldf
118+
*.ndf
119+
120+
.ntvs_analysis.dat
121+
node_modules/
122+
123+
BenchmarkDotNet.Artifacts/
124+
125+
.tye/
126+
127+
*.coverage
128+
*.coveragexml
129+
coverage.json
130+
coverage.opencover.xml
131+
132+
.localhistory/
133+
134+
Thumbs.db
135+
Thumbs.db:encryptable
136+
ehthumbs.db
137+
138+
[Dd]esktop.ini
139+
140+
.DS_Store
141+
142+
*.sln.iml
143+
144+
[Tt]est[Rr]esult*/
145+
[Bb]uild[Ll]og.*
146+
147+
*.VisualState.xml
148+
TestResult.xml
149+
nunit-*.xml
150+
151+
ocr/

0 commit comments

Comments
 (0)