|
| 1 | +name: Release C# Plugin |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag: |
| 7 | + description: "Tag for the plugin release (e.g. plugin-csharp-v1.0.0)" |
| 8 | + required: true |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + release: |
| 15 | + name: Build and Release C# Plugin |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Set up .NET |
| 23 | + uses: actions/setup-dotnet@v4 |
| 24 | + with: |
| 25 | + dotnet-version: "8.0.x" |
| 26 | + |
| 27 | + - name: Restore dependencies |
| 28 | + working-directory: plugin/csharp |
| 29 | + run: dotnet restore |
| 30 | + |
| 31 | + - name: Build and publish |
| 32 | + working-directory: plugin/csharp |
| 33 | + run: | |
| 34 | + mkdir -p release |
| 35 | + # Linux glibc x64 (Ubuntu, Debian, etc.) |
| 36 | + dotnet publish CanopyPlugin.csproj -c Release -r linux-x64 --self-contained true -o release/linux-glibc-x64 |
| 37 | + # Linux glibc ARM64 |
| 38 | + dotnet publish CanopyPlugin.csproj -c Release -r linux-arm64 --self-contained true -o release/linux-glibc-arm64 |
| 39 | + # Linux musl x64 (Alpine Docker) |
| 40 | + dotnet publish CanopyPlugin.csproj -c Release -r linux-musl-x64 --self-contained true -o release/linux-musl-x64 |
| 41 | + # Linux musl ARM64 (Alpine Docker) |
| 42 | + dotnet publish CanopyPlugin.csproj -c Release -r linux-musl-arm64 --self-contained true -o release/linux-musl-arm64 |
| 43 | +
|
| 44 | + - name: Create tarballs |
| 45 | + working-directory: plugin/csharp |
| 46 | + run: | |
| 47 | + cd release |
| 48 | + # glibc versions (standard Linux) |
| 49 | + tar -czf csharp-plugin-linux-x64.tar.gz -C linux-glibc-x64 . |
| 50 | + tar -czf csharp-plugin-linux-arm64.tar.gz -C linux-glibc-arm64 . |
| 51 | + # musl versions (Alpine Docker) |
| 52 | + tar -czf csharp-plugin-linux-musl-x64.tar.gz -C linux-musl-x64 . |
| 53 | + tar -czf csharp-plugin-linux-musl-arm64.tar.gz -C linux-musl-arm64 . |
| 54 | +
|
| 55 | + - name: Create GitHub release |
| 56 | + uses: softprops/action-gh-release@v2 |
| 57 | + with: |
| 58 | + tag_name: ${{ github.event.inputs.tag }} |
| 59 | + name: "C# Plugin ${{ github.event.inputs.tag }}" |
| 60 | + body: | |
| 61 | + C# Plugin Release ${{ github.event.inputs.tag }} |
| 62 | + |
| 63 | + ## Installation |
| 64 | + 1. Extract the appropriate tarball to `plugin/csharp/bin/` |
| 65 | + 2. The plugin is self-contained (no .NET runtime required) |
| 66 | + |
| 67 | + ## Assets |
| 68 | + ### Standard Linux (glibc) - Ubuntu, Debian, RHEL, etc. |
| 69 | + - `csharp-plugin-linux-x64.tar.gz` - Linux x86_64 |
| 70 | + - `csharp-plugin-linux-arm64.tar.gz` - Linux ARM64 |
| 71 | + |
| 72 | + ### Alpine Linux (musl) - Docker containers |
| 73 | + - `csharp-plugin-linux-musl-x64.tar.gz` - Alpine x86_64 |
| 74 | + - `csharp-plugin-linux-musl-arm64.tar.gz` - Alpine ARM64 |
| 75 | + files: | |
| 76 | + plugin/csharp/release/csharp-plugin-linux-x64.tar.gz |
| 77 | + plugin/csharp/release/csharp-plugin-linux-arm64.tar.gz |
| 78 | + plugin/csharp/release/csharp-plugin-linux-musl-x64.tar.gz |
| 79 | + plugin/csharp/release/csharp-plugin-linux-musl-arm64.tar.gz |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments