Add multi-version workspace and comparison tools #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@v5 | |
| - name: Set up .NET 10 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Validate tag matches project version | |
| shell: bash | |
| run: | | |
| project_version="$(grep -oPm1 '(?<=<Version>)[^<]+' DecompilerServer.csproj)" | |
| tag_version="${GITHUB_REF_NAME#v}" | |
| if [[ -z "$project_version" ]]; then | |
| echo "Could not read <Version> from DecompilerServer.csproj" | |
| exit 1 | |
| fi | |
| if [[ "$project_version" != "$tag_version" ]]; then | |
| echo "Tag version '$tag_version' does not match project version '$project_version'" | |
| exit 1 | |
| fi | |
| - name: Build release | |
| run: dotnet build DecompilerServer.sln -c Release | |
| - name: Run tests | |
| run: dotnet test Tests/Tests.csproj -c Release --no-build | |
| create-release: | |
| needs: verify | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@v5 | |
| - name: Ensure GitHub release exists | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1 || \ | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --verify-tag \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --generate-notes | |
| publish-assets: | |
| needs: | |
| - verify | |
| - create-release | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - rid: osx-arm64 | |
| executable: DecompilerServer | |
| archive_ext: tar.gz | |
| - rid: osx-x64 | |
| executable: DecompilerServer | |
| archive_ext: tar.gz | |
| - rid: linux-x64 | |
| executable: DecompilerServer | |
| archive_ext: tar.gz | |
| - rid: linux-arm64 | |
| executable: DecompilerServer | |
| archive_ext: tar.gz | |
| - rid: win-x64 | |
| executable: DecompilerServer.exe | |
| archive_ext: zip | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@v5 | |
| - name: Set up .NET 10 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Publish single-file bundle | |
| run: > | |
| dotnet publish DecompilerServer.csproj | |
| -c Release | |
| -r ${{ matrix.rid }} | |
| --self-contained false | |
| -p:PublishSingleFile=true | |
| -p:DebugSymbols=false | |
| -p:DebugType=None | |
| -o out/publish/${{ matrix.rid }} | |
| - name: Stage release payload | |
| shell: bash | |
| env: | |
| ARCHIVE_EXT: ${{ matrix.archive_ext }} | |
| EXECUTABLE: ${{ matrix.executable }} | |
| RID: ${{ matrix.rid }} | |
| RELEASE_TAG: ${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| asset_base="decompilerserver-${RELEASE_TAG}-${RID}" | |
| publish_dir="out/publish/${RID}" | |
| stage_dir="dist/${asset_base}" | |
| mkdir -p "$stage_dir" | |
| cp "$publish_dir/${EXECUTABLE}" "$stage_dir/" | |
| cp README.md LICENSE "$stage_dir/" | |
| cat > "$stage_dir/INSTALL.txt" <<EOF | |
| DecompilerServer ${RELEASE_TAG} | |
| Platform: ${RID} | |
| Package type: framework-dependent single-file | |
| This build requires the .NET 10 runtime to be installed on the target machine. | |
| Launch the MCP server by pointing your client at: | |
| - ${EXECUTABLE} | |
| See README.md for example MCP client launch configuration. | |
| EOF | |
| if [[ "$ARCHIVE_EXT" == "zip" ]]; then | |
| ( | |
| cd dist | |
| zip -qr "${asset_base}.zip" "${asset_base}" | |
| ) | |
| else | |
| tar -C dist -czf "dist/${asset_base}.tar.gz" "${asset_base}" | |
| fi | |
| - name: Upload release artifacts | |
| env: | |
| ARCHIVE_EXT: ${{ matrix.archive_ext }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RID: ${{ matrix.rid }} | |
| RELEASE_TAG: ${{ github.ref_name }} | |
| run: | | |
| asset_base="decompilerserver-${RELEASE_TAG}-${RID}" | |
| gh release upload \ | |
| "$RELEASE_TAG" \ | |
| "dist/${asset_base}.${ARCHIVE_EXT}" \ | |
| --clobber |