|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*.*.*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write # needed to create GitHub Releases |
| 10 | + |
| 11 | +jobs: |
| 12 | + # ── 1. Gate: run the full test matrix before publishing ──────────────────── |
| 13 | + test: |
| 14 | + name: Test (${{ matrix.os }}) |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Setup .NET 10 |
| 25 | + uses: actions/setup-dotnet@v4 |
| 26 | + with: |
| 27 | + dotnet-version: '10.0.x' |
| 28 | + |
| 29 | + - name: Restore |
| 30 | + run: dotnet restore CSharpEditorPlugin.slnx |
| 31 | + |
| 32 | + - name: Build |
| 33 | + run: dotnet build CSharpEditorPlugin.slnx -c Release --no-restore |
| 34 | + |
| 35 | + - name: Test |
| 36 | + run: dotnet test CSharpEditorPlugin.slnx -c Release --no-build --verbosity normal |
| 37 | + |
| 38 | + # ── 2. Build the .fryplugin archive and publish the GitHub Release ────────── |
| 39 | + release: |
| 40 | + name: Build & Publish Release |
| 41 | + needs: test |
| 42 | + runs-on: ubuntu-latest |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v4 |
| 47 | + |
| 48 | + - name: Setup .NET 10 |
| 49 | + uses: actions/setup-dotnet@v4 |
| 50 | + with: |
| 51 | + dotnet-version: '10.0.x' |
| 52 | + |
| 53 | + - name: Restore |
| 54 | + run: dotnet restore CSharpEditorPlugin.slnx |
| 55 | + |
| 56 | + # Release build triggers the PackageFryPlugin MSBuild target which |
| 57 | + # produces bin/Release/net10.0/CSharpEditor.fryplugin |
| 58 | + - name: Build Release (produces .fryplugin) |
| 59 | + run: dotnet build CSharpEditorPlugin.csproj -c Release --no-restore |
| 60 | + |
| 61 | + # Derive the clean version string from the tag (strips leading 'v') |
| 62 | + - name: Extract version from tag |
| 63 | + id: version |
| 64 | + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" |
| 65 | + |
| 66 | + # Locate the produced archive so later steps can reference it |
| 67 | + - name: Locate .fryplugin artifact |
| 68 | + id: artifact |
| 69 | + run: | |
| 70 | + FRYPLUGIN=$(find . -name "*.fryplugin" | head -1) |
| 71 | + echo "PATH=$FRYPLUGIN" >> "$GITHUB_OUTPUT" |
| 72 | + echo "Found: $FRYPLUGIN" |
| 73 | +
|
| 74 | + - name: Create GitHub Release |
| 75 | + uses: softprops/action-gh-release@v2 |
| 76 | + with: |
| 77 | + tag_name: ${{ github.ref_name }} |
| 78 | + name: "C# Code Studio ${{ github.ref_name }}" |
| 79 | + body: | |
| 80 | + ## C# Code Studio ${{ github.ref_name }} |
| 81 | +
|
| 82 | + ### Installation |
| 83 | + 1. Download `CSharpEditor.fryplugin` below. |
| 84 | + 2. In FryPDF, open **Plugins → Install from file** and select the downloaded archive. |
| 85 | +
|
| 86 | + ### What's new |
| 87 | + See [CHANGELOG](https://github.com/${{ github.repository }}/commits/${{ github.ref_name }}) for the full list of commits in this release. |
| 88 | +
|
| 89 | + --- |
| 90 | + **Plugin ID:** `com.frypdf.plugin.csharpeditor` |
| 91 | + **Version:** `${{ steps.version.outputs.VERSION }}` |
| 92 | + **Target:** `.NET 10 / Roslyn 4.12` |
| 93 | + draft: false |
| 94 | + prerelease: ${{ contains(github.ref_name, '-') }} |
| 95 | + files: ${{ steps.artifact.outputs.PATH }} |
| 96 | + fail_on_unmatched_files: true |
0 commit comments