diff --git a/.github/workflows/publish-objectivec-apidocs.yml b/.github/workflows/publish-objectivec-apidocs.yml new file mode 100644 index 0000000000..9ce6e68c5b --- /dev/null +++ b/.github/workflows/publish-objectivec-apidocs.yml @@ -0,0 +1,51 @@ +name: Update Objective-C API Docs + +# Run when the Objective-C API changes or every month so that the artifact does not expire +on: + push: + branches: + - main + paths: + - objectivec + schedule: + - cron: '0 0 1 * *' + workflow_dispatch: + +concurrency: + group: "apidocs-objectivec" + cancel-in-progress: false + +permissions: + contents: write + +jobs: + build: + name: Generate Objective-C API docs + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + + - name: Install Jazzy + run: | + sudo gem install jazzy --version 0.14.3 + + - name: Generate Objective-C docs + run: | + set -e + + # add commit info to main page of generated docs + ORT_COMMIT_SHORT="$(git rev-parse --short HEAD)" + printf "\n%s\n" \ + "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 \ + --clean --output ./_site/docs/api/objectivec + shell: bash + + - name: Upload new site + uses: actions/upload-artifact@v3 + with: + name: onnxruntime-objectivec-apidocs + path: ./_site + retention-days: 60 diff --git a/objectivec/docs/jazzy_config.yaml b/objectivec/docs/jazzy_config.yaml index 3153a6acea..676f89d79d 100644 --- a/objectivec/docs/jazzy_config.yaml +++ b/objectivec/docs/jazzy_config.yaml @@ -7,7 +7,7 @@ objc: true umbrella_header: ../include/onnxruntime.h framework_root: .. -readme: ./docs.readme.md +readme: ./main_page.md hide_documentation_coverage: true undocumented_text: "" diff --git a/objectivec/docs/docs.readme.md b/objectivec/docs/main_page.md similarity index 100% rename from objectivec/docs/docs.readme.md rename to objectivec/docs/main_page.md diff --git a/objectivec/docs/readme.md b/objectivec/docs/readme.md index bb8e8cac37..5697480290 100644 --- a/objectivec/docs/readme.md +++ b/objectivec/docs/readme.md @@ -6,7 +6,7 @@ The API should be documented with comments in the [public header files](../inclu The [Jazzy](https://github.com/realm/jazzy) tool is used to generate documentation from the code. -For example, to generate documentation for a release version, from the repo root, run: +To generate documentation, from the repo root, run: ```bash jazzy --config objectivec/docs/jazzy_config.yaml --output @@ -14,4 +14,4 @@ jazzy --config objectivec/docs/jazzy_config.yaml --output The generated documentation website files will be in ``. -[docs.readme.md](./docs.readme.md) contains content for the main page of the generated documentation website. +[main_page.md](./main_page.md) contains content for the main page of the generated documentation website. diff --git a/tools/ci_build/github/apple/assemble_ios_packaging_artifacts.sh b/tools/ci_build/github/apple/assemble_ios_packaging_artifacts.sh index 25d5bd3882..e71ac75e6c 100755 --- a/tools/ci_build/github/apple/assemble_ios_packaging_artifacts.sh +++ b/tools/ci_build/github/apple/assemble_ios_packaging_artifacts.sh @@ -53,12 +53,3 @@ assemble_and_upload_pod "onnxruntime-mobile-c" assemble_and_upload_pod "onnxruntime-mobile-objc" assemble_and_upload_pod "onnxruntime-c" assemble_and_upload_pod "onnxruntime-objc" - -cd ${BINARIES_STAGING_DIR}/objc_api_docs -zip -r ${ARTIFACTS_STAGING_DIR}/objc_api_docs.zip * - -cat > ${ARTIFACTS_STAGING_DIR}/readme.txt <<'EOM' -Release TODO: -- publish the podspecs -- publish the Objective-C API documentation -EOM diff --git a/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml index fa35c34a99..0904047f37 100644 --- a/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/mac-ios-packaging-pipeline.yml @@ -175,13 +175,6 @@ jobs: --token $(app_center_api_token) displayName: "[Full] Run E2E tests on App Center" - - bash: | - set -e - gem install jazzy - jazzy --config objectivec/docs/jazzy_config.yaml \ - --output "$(Build.BinariesDirectory)/staging/objc_api_docs" - displayName: "Generate Objective-C API docs" - - task: AzureCLI@2 inputs: azureSubscription: 'AIInfraBuildOnnxRuntimeOSS'