maple-proxy 0.1.10

Lightweight OpenAI-compatible proxy server for Maple/OpenSecret TEE infrastructure
Documentation
name: Release

on:
  push:
    branches: [ main, master ]
    tags:
      - 'v*'
  pull_request:
    branches: [ main, master ]

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build ${{ matrix.name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          # Linux x86_64
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
            name: linux-x86_64
          
          # Linux ARM64 (native build on ARM runner)
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-22.04-arm64-4core
            name: linux-aarch64
          
          # macOS Apple Silicon (M1/M2/M3)
          - target: aarch64-apple-darwin
            os: macos-latest
            name: macos-aarch64
          
          # Windows x86_64
          - target: x86_64-pc-windows-msvc
            os: windows-latest
            name: windows-x86_64

    steps:
      - name: Checkout sources
        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
        with:
          persist-credentials: false

      - name: Install stable toolchain
        uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
        with:
          target: ${{ matrix.target }}

      - name: Build binary
        run: cargo build --release --target ${{ matrix.target }}

      - name: Package binary (Unix)
        if: matrix.os != 'windows-latest'
        run: |
          cd target/${{ matrix.target }}/release
          tar -czf ../../../maple-proxy-${{ matrix.name }}.tar.gz maple-proxy
          cd -
          echo "ASSET_PATH=maple-proxy-${{ matrix.name }}.tar.gz" >> $GITHUB_ENV

      - name: Package binary (Windows)
        if: matrix.os == 'windows-latest'
        shell: pwsh
        run: |
          cd target/${{ matrix.target }}/release
          7z a ../../../maple-proxy-${{ matrix.name }}.zip maple-proxy.exe
          cd -
          echo "ASSET_PATH=maple-proxy-${{ matrix.name }}.zip" >> $env:GITHUB_ENV

      - name: Upload artifact
        if: github.event_name != 'pull_request'
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
        with:
          name: maple-proxy-${{ matrix.name }}
          path: ${{ env.ASSET_PATH }}
          retention-days: 7

  release:
    name: Create Release
    if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
    needs: build
    runs-on: ubuntu-latest
    permissions:
      contents: write
    
    steps:
      - name: Checkout sources
        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
        with:
          persist-credentials: false

      - name: Download all artifacts
        uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
        with:
          path: artifacts

      - name: Generate checksums
        run: |
          cd artifacts
          for dir in */; do
            cd "$dir"
            for file in *; do
              sha256sum "$file" > "$file.sha256"
              mv "$file" "$file.sha256" ../
            done
            cd ..
            rmdir "$dir"
          done
          cd ..

      - name: Generate release notes
        id: release_notes
        run: |
          VERSION=${GITHUB_REF#refs/tags/}
          echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
          cat << EOF > release_notes.md
          ## 🚀 Maple Proxy $VERSION
          
          ### Installation
          
          #### 🐳 Docker
          \`\`\`bash
          docker pull ghcr.io/opensecretcloud/maple-proxy:$VERSION
          \`\`\`
          
          #### 📦 Pre-built Binaries
          Download the appropriate binary for your platform below.
          
          #### 🔧 From Source
          \`\`\`bash
          cargo install --git https://github.com/OpenSecretCloud/maple-proxy --tag $VERSION
          \`\`\`
          
          ### Checksums
          All binaries include SHA256 checksums for verification.
          
          ### Supported Platforms
          - Linux x86_64
          - Linux ARM64
          - macOS Apple Silicon (M1/M2/M3)
          - Windows x86_64
          EOF

      - name: Create GitHub Release
        uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
        with:
          name: Release ${{ steps.release_notes.outputs.VERSION }}
          body_path: release_notes.md
          files: artifacts/*
          draft: false
          prerelease: false
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}