Release #12
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: | |
| workflow_dispatch: # manual trigger release | |
| inputs: | |
| create_release: | |
| description: 'Create new release' | |
| required: true | |
| type: boolean | |
| release_version: | |
| description: "Version (e.g. 1.0.0)" | |
| required: true | |
| type: string | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| build: [linux-x86_64, linux-aarch64, macos-x86_64, macos-arm64] | |
| include: | |
| - build: linux-x86_64 | |
| os: ubuntu-22.04 | |
| rust: nightly | |
| target: x86_64-unknown-linux-gnu | |
| archive-name: gaia-mcp-servers-linux-unknown-gnu-x86_64.tar.gz | |
| bin-path: linux-x86_64-binary | |
| - build: linux-aarch64 | |
| os: ubuntu-22.04-arm | |
| rust: nightly | |
| target: aarch64-unknown-linux-gnu | |
| archive-name: gaia-mcp-servers-linux-unknown-gnu-aarch64.tar.gz | |
| bin-path: linux-aarch64-binary | |
| - build: macos-x86_64 | |
| os: macos-latest | |
| rust: nightly | |
| target: x86_64-apple-darwin | |
| archive-name: gaia-mcp-servers-apple-darwin-x86_64.tar.gz | |
| bin-path: macos-x86_64-binary | |
| - build: macos-arm64 | |
| os: macos-latest | |
| rust: nightly | |
| target: aarch64-apple-darwin | |
| archive-name: gaia-mcp-servers-apple-darwin-aarch64.tar.gz | |
| bin-path: macos-arm64-binary | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repository | |
| id: checkout | |
| uses: actions/checkout@v3 | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| profile: minimal | |
| override: true | |
| target: ${{ matrix.target }} | |
| - name: Install dependencies | |
| if: matrix.build == 'linux-x86_64' || matrix.build == 'linux-aarch64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential pkg-config | |
| rustup target add ${{ matrix.target }} | |
| - name: Build binary (linux and macos) | |
| run: cargo build --verbose --release --target ${{ matrix.target }} | |
| env: | |
| RUST_BACKTRACE: 1 | |
| - name: Strip binary (linux and macos) | |
| if: matrix.build == 'linux-x86_64' || matrix.build == 'linux-aarch64' || matrix.build == 'macos-x86_64' || matrix.build == 'macos-arm64' | |
| run: | | |
| strip "target/${{ matrix.target }}/release/gaia-calculator-mcp-server" | |
| strip "target/${{ matrix.target }}/release/gaia-weather-mcp-server" | |
| strip "target/${{ matrix.target }}/release/gaia-qdrant-mcp-server" | |
| strip "target/${{ matrix.target }}/release/gaia-kwsearch-mcp-server" | |
| strip "target/${{ matrix.target }}/release/gaia-elastic-mcp-server" | |
| strip "target/${{ matrix.target }}/release/gaia-tidb-mcp-server" | |
| ls -al "target/${{ matrix.target }}/release" | |
| - name: Build archive | |
| shell: bash | |
| run: | | |
| mkdir archive | |
| cd archive | |
| if [ "${{ matrix.build }}" = "linux-x86_64" ] || [ "${{ matrix.build }}" = "linux-aarch64" ]; then | |
| cp "../target/${{ matrix.target }}/release/gaia-calculator-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-weather-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-qdrant-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-kwsearch-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-elastic-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-tidb-mcp-server" ./ | |
| tar -czf "${{ matrix.archive-name }}" * | |
| fi | |
| if [ "${{ matrix.build }}" = "macos-x86_64" ] || [ "${{ matrix.build }}" = "macos-arm64" ]; then | |
| cp "../target/${{ matrix.target }}/release/gaia-calculator-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-weather-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-qdrant-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-kwsearch-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-elastic-mcp-server" ./ | |
| cp "../target/${{ matrix.target }}/release/gaia-tidb-mcp-server" ./ | |
| tar -czf "${{ matrix.archive-name }}" * | |
| fi | |
| ls -al | |
| - name: Upload archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.bin-path }} | |
| path: archive/${{ matrix.archive-name }} | |
| release: | |
| name: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: build | |
| steps: | |
| - name: Download artifacts (linux-x86_64-binary) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-x86_64-binary | |
| path: linux-x86_64-binary | |
| - name: Download artifacts (linux-aarch64-binary) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-aarch64-binary | |
| path: linux-aarch64-binary | |
| - name: Download artifacts (macos-x86_64-binary) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-x86_64-binary | |
| path: macos-x86_64-binary | |
| - name: Download artifacts (macos-arm64-binary) | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-arm64-binary | |
| path: macos-arm64-binary | |
| - name: Display structure of downloaded files | |
| run: | | |
| ls -al | |
| ls -al linux-x86_64-binary | |
| ls -al linux-aarch64-binary | |
| ls -al macos-x86_64-binary | |
| ls -al macos-arm64-binary | |
| - name: Tag and release names | |
| id: tag_and_release_names | |
| run: | | |
| echo "tag_name=${{ github.event.inputs.release_version }}" >> $GITHUB_OUTPUT | |
| echo "release_name=Gaia-MCP-Servers ${{ github.event.inputs.release_version }}" >> $GITHUB_OUTPUT | |
| - name: Create Release and Upload Release Asset | |
| if: ${{ github.event.inputs.create_release == 'true' && github.ref == 'refs/heads/main'}} | |
| uses: softprops/action-gh-release@v2.2.2 | |
| with: | |
| name: ${{ steps.tag_and_release_names.outputs.release_name }} | |
| tag_name: ${{ steps.tag_and_release_names.outputs.tag_name }} | |
| body: TODO New Release. | |
| draft: true | |
| prerelease: true | |
| files: | | |
| linux-x86_64-binary/* | |
| linux-aarch64-binary/* | |
| macos-x86_64-binary/* | |
| macos-arm64-binary/* |