fix: task tool MCP schemas and Rust serde parity (Fixes #7) #11
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-rust | |
| on: | |
| push: | |
| tags: | |
| - "rust-v*" | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| validate_version: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: validate tag version matches cargo version | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#rust-v}" | |
| CARGO_VERSION="$(awk -F '"' '$1 ~ /^version = / { print $2; exit }' rust/Cargo.toml)" | |
| if [ -z "${CARGO_VERSION}" ]; then | |
| echo "failed to read version from rust/Cargo.toml" | |
| exit 1 | |
| fi | |
| if [ "${TAG_VERSION}" != "${CARGO_VERSION}" ]; then | |
| echo "tag version (${TAG_VERSION}) does not match rust/Cargo.toml version (${CARGO_VERSION})" | |
| exit 1 | |
| fi | |
| build: | |
| needs: validate_version | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: install rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: build release binary | |
| run: cargo build --manifest-path rust/Cargo.toml --release --target "${{ matrix.target }}" | |
| - name: package tarball and checksum | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#rust-v}" | |
| TARGET="${{ matrix.target }}" | |
| STAGE_DIR="release-artifacts" | |
| mkdir -p "${STAGE_DIR}" | |
| cp "rust/target/${TARGET}/release/omnifocus-mcp" "${STAGE_DIR}/omnifocus-mcp" | |
| TAR_NAME="omnifocus-mcp-${VERSION}-${TARGET}.tar.gz" | |
| tar -C "${STAGE_DIR}" -czf "${STAGE_DIR}/${TAR_NAME}" omnifocus-mcp | |
| SHA="$(shasum -a 256 "${STAGE_DIR}/${TAR_NAME}" | awk '{print $1}')" | |
| printf "%s %s\n" "${SHA}" "${TAR_NAME}" > "${STAGE_DIR}/${TAR_NAME}.sha256" | |
| rm "${STAGE_DIR}/omnifocus-mcp" | |
| - name: upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rust-${{ matrix.target }} | |
| path: release-artifacts/* | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release | |
| merge-multiple: true | |
| - name: build release notes with shas | |
| run: | | |
| { | |
| echo "## Rust binaries" | |
| echo | |
| echo "SHA256 checksums for Homebrew formula:" | |
| echo | |
| for file in release/*.sha256; do | |
| cat "$file" | |
| done | |
| } > release-notes.md | |
| - name: publish github release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| files: | | |
| release/*.tar.gz | |
| release/*.sha256 | |
| body_path: release-notes.md |