Skip to content

Commit 4e42fdd

Browse files
v1.0.0 (#1)
* Initial version
1 parent de6a2cb commit 4e42fdd

25 files changed

+4229
-1
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[*.yaml]
2+
indent_size = 2
3+
tab_width = 2
4+
5+
[*.cs]
6+
7+
# StyleCop
8+
9+
# SA1600: Elements should be documented
10+
dotnet_diagnostic.SA1600.severity = none
11+
12+
# SA1601: Partial elements should be documented
13+
dotnet_diagnostic.SA1601.severity = none
14+
15+
# SA1602: Enumeration items should be documented
16+
dotnet_diagnostic.SA1602.severity = none
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "releases/**" ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup .NET 8.x
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: '8.x'
19+
20+
- name: Build
21+
run: dotnet build --property:Configuration=Debug "PosInformatique.Pdf.PasswordRemover.sln"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
VersionPrefix:
7+
type: string
8+
description: The version of the library
9+
required: true
10+
default: 0.9.0
11+
VersionSuffix:
12+
type: string
13+
description: The version suffix of the library (for example rc.1)
14+
15+
run-name: ${{ inputs.VersionPrefix }}${{ inputs.VersionSuffix && '-' || '' }}${{ inputs.VersionSuffix }}
16+
17+
jobs:
18+
build:
19+
env:
20+
SETUP_PROJECT_FILE: "./src/Pdf.PasswordRemover.WinForms.Setup/Pdf.PasswordRemover.WinForms.Setup.vdproj"
21+
VERSION: ${{ inputs.VersionPrefix }}${{ inputs.VersionSuffix && '-' || '' }}${{ inputs.VersionSuffix }}
22+
runs-on: windows-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Setup .NET 8.x SDK
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: '8.x'
30+
31+
- name: Build executable application
32+
run: dotnet build --property:Configuration=Release --property:AssemblyVersion=${{ inputs.VersionPrefix }} --property:FileVersion=${{ inputs.VersionPrefix }} --property:InformationalVersion=${{ env.VERSION }} "./src/Pdf.PasswordRemover.WinForms/Pdf.PasswordRemover.WinForms.csproj"
33+
34+
- name: Setup Visual Studio environment
35+
uses: seanmiddleditch/gha-setup-vsdevenv@v4
36+
37+
- name: Update the .vdproj file
38+
shell: pwsh
39+
run: |
40+
$newProductCode = [System.Guid]::NewGuid().ToString("B").ToUpper()
41+
$content = Get-Content -Path $env:SETUP_PROJECT_FILE -Raw
42+
43+
$content = $content -replace '"ProductVersion" = "8:.*?"', '"ProductVersion" = "8:${{ inputs.VersionPrefix }}"'
44+
$content = $content -replace '"OutputFilename" = "8:Release\\\\PdfPasswordRemover.msi"', '"OutputFilename" = "8:Release\\PdfPasswordRemover_${{ env.VERSION }}.msi"'
45+
$content = $content -replace '"ProductCode" = "8:{CB215E38-E864-48E0-851B-6B2B67958B42}"', ('"ProductCode" = "8:' + $newProductCode + '"')
46+
47+
Set-Content -Path $env:SETUP_PROJECT_FILE -Value $content
48+
49+
Write-Host "Version updated to '${{ inputs.VersionPrefix }}' in '$env:SETUP_PROJECT_FILE'"
50+
Write-Host "OutputFilename property updated to 'Release\\PdfPasswordRemover_${{ env.VERSION }}.msi' in '$env:SETUP_PROJECT_FILE'"
51+
Write-Host "ProductCode property updated to '$newProductCode' in '$env:SETUP_PROJECT_FILE'"
52+
53+
- name: Build MSI package
54+
run: devenv "${{ env.SETUP_PROJECT_FILE }}" /Build "Release"
55+
56+
- name: Upload MSI package
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: installer
60+
path: |
61+
./src/Pdf.PasswordRemover.WinForms.Setup/Release/

0 commit comments

Comments
 (0)