Skip to content

Commit

Permalink
Merge pull request #136 from team-telnyx/feat/WEBRTC-2341-docs
Browse files Browse the repository at this point in the history
[WEBRTC-2341] [FEAT] docs pipeline
  • Loading branch information
gbattistel authored Nov 15, 2024
2 parents 0f3824c + 31d253c commit 31cdd27
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 14 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: generate_full_docs
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
generate_docs:
name: Generate Docs
runs-on: macos-latest

steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main # Aseguramos que estamos trabajando con la rama main

- name: Select the latest Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest' # Use the latest version of Xcode available on GitHub Actions

- name: Setup Ruby 3.3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true

- name: Install Fastlane, Jazzy, and SourceDocs
run: |
gem install fastlane
gem install jazzy
gem install sourcedocs
- name: Install dependencies (Pods)
run: |
pod install
- name: Run Fastlane to generate full documentation
run: |
fastlane generate_full_docs
- name: Setup Git user
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Commit and push docs
run: |
git add docs/ docs_markdown/
git commit -m "docs: Generated full documentation"
git push
32 changes: 32 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,35 @@ changelog = lane_context[SharedValues::FL_CHANGELOG]
File.open("changelog.txt", 'w') { |file| file.write("#{changelog}") }

end


desc "Generate documentation using Jazzy - HTML docs"
lane :generate_docs do
sh <<-SHELL
cd .. && jazzy \
--clean \
--author "Telnyx LLC" \
--author_url "https://www.telnyx.com/" \
--xcodebuild-arguments -workspace,TelnyxRTC.xcworkspace,-scheme,TelnyxRTC,-sdk,iphoneos \
--output ./docs
SHELL
UI.message("📚 Documentation generated in ./docs")
end

desc "Generate documentation using SourceDocs - Markdown docs"
lane :generate_docs_markdown do
sh <<-SHELL
cd .. && sourcedocs generate --output-folder ./docs_markdown \
-- \
-workspace TelnyxRTC.xcworkspace \
-scheme TelnyxRTC
SHELL
UI.message("📄 Markdown documentation generated in ./markdown")
end

desc "Generate HTML and Markdown documentation"
lane :generate_full_docs do
generate_docs
generate_docs_markdown
UI.success("✅ Documentation successfully generated and converted to Markdown")
end
65 changes: 51 additions & 14 deletions fastlane/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,70 @@
fastlane documentation
================
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
```sh
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

### lint

```sh
[bundle exec] fastlane lint
```
fastlane lint
```

Does a static analysis of the project. Configure the options in .swiftlint.yml

### tests

```sh
[bundle exec] fastlane tests
```
fastlane tests
```

Run unit tests.

### changelog

```sh
[bundle exec] fastlane changelog
```

Create a file with the Changelog output between a specific TAG and HEAD

### generate_docs

```sh
[bundle exec] fastlane generate_docs
```

Generate documentation using Jazzy - HTML docs

### generate_docs_markdown

```sh
[bundle exec] fastlane generate_docs_markdown
```

Generate documentation using SourceDocs - Markdown docs

### generate_full_docs

```sh
[bundle exec] fastlane generate_full_docs
```

Generate HTML and Markdown documentation

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

0 comments on commit 31cdd27

Please sign in to comment.