diff --git a/.github/workflows/publish-objectivec-apidocs.yml b/.github/workflows/publish-objectivec-apidocs.yml index 5fa1ae0a76bda..ad7d9f2f25fa0 100644 --- a/.github/workflows/publish-objectivec-apidocs.yml +++ b/.github/workflows/publish-objectivec-apidocs.yml @@ -30,9 +30,11 @@ jobs: timeout-minutes: 120 steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + - name: Get vcpkg tool info id: vcpkg-tool-info uses: ./.github/actions/get-vcpkg-tool-info + - uses: microsoft/onnxruntime-github-actions/setup-build-tools@d19341fb036c43a947a2c0e4a53ad4d15e10bc5c # v0.0.9 with: vcpkg-version: ${{ steps.vcpkg-tool-info.outputs.release_tag }} @@ -42,11 +44,14 @@ jobs: add-cmake-to-path: 'true' disable-terrapin: 'true' - - name: Install Jazzy - run: | - sudo gem install jazzy --version 0.14.3 + - name: Install Jazzy and dependencies + env: + BUNDLE_GEMFILE: ./objectivec/docs/Gemfile + run: bundle install - name: Generate Objective-C docs + env: + BUNDLE_GEMFILE: ./objectivec/docs/Gemfile run: | set -e @@ -56,7 +61,7 @@ jobs: "This documentation was generated from the ONNX Runtime source at commit ${ORT_COMMIT_SHORT}." \ >> ./objectivec/docs/main_page.md - jazzy --config ./objectivec/docs/jazzy_config.yaml \ + bundle exec jazzy --config ./objectivec/docs/jazzy_config.yaml \ --clean --output ./_site/docs/api/objectivec shell: bash diff --git a/objectivec/docs/Gemfile b/objectivec/docs/Gemfile new file mode 100644 index 0000000000000..192af7e9e482c --- /dev/null +++ b/objectivec/docs/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gem "jazzy", "0.15.4" +gem "mustache", "< 1.1.3" # Work around https://github.com/realm/jazzy/issues/1435. diff --git a/objectivec/docs/readme.md b/objectivec/docs/readme.md index 56974802900bc..894aece5ca2a3 100644 --- a/objectivec/docs/readme.md +++ b/objectivec/docs/readme.md @@ -4,12 +4,23 @@ The API should be documented with comments in the [public header files](../inclu ## Documentation Generation +Documentation generation dependencies are defined in [Gemfile](./Gemfile) and managed with +[Bundler](https://bundler.io/). + The [Jazzy](https://github.com/realm/jazzy) tool is used to generate documentation from the code. -To generate documentation, from the repo root, run: +To install the dependencies, from the repo root, run: + +```bash +BUNDLE_GEMFILE=objectivec/docs/Gemfile bundle install +``` + +Then, to generate the documentation, run: ```bash -jazzy --config objectivec/docs/jazzy_config.yaml --output +BUNDLE_GEMFILE=objectivec/docs/Gemfile bundle exec jazzy \ + --config objectivec/docs/jazzy_config.yaml \ + --output ``` The generated documentation website files will be in ``.