67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: docs
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
PLAYDATE_SDK_VERSION: "3.1.1"
|
|
|
|
jobs:
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: latest
|
|
|
|
- name: Cache Playdate SDK
|
|
id: sdk-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/PlaydateSDK
|
|
key: playdate-sdk-${{ env.PLAYDATE_SDK_VERSION }}
|
|
|
|
- name: Download Playdate SDK headers
|
|
if: steps.sdk-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
curl -sL "https://download.panic.com/playdate_sdk/Linux/PlaydateSDK-${PLAYDATE_SDK_VERSION}.tar.gz" | tar xz -C "$HOME"
|
|
mv "$HOME/PlaydateSDK-${PLAYDATE_SDK_VERSION}" "$HOME/PlaydateSDK"
|
|
test -f "$HOME/PlaydateSDK/C_API/pd_api.h"
|
|
|
|
- name: Install pkg-config module
|
|
run: |
|
|
PLAYDATE_SDK_PATH="$HOME/PlaydateSDK" Scripts/install-pkgconfig.sh "$HOME/pkgconfig"
|
|
echo "PKG_CONFIG_PATH=$HOME/pkgconfig" >> "$GITHUB_ENV"
|
|
|
|
- name: Generate documentation
|
|
run: |
|
|
swift package --allow-writing-to-directory docs \
|
|
generate-documentation --target PlaydateKit \
|
|
--disable-indexing \
|
|
--transform-for-static-hosting \
|
|
--hosting-base-path playdate-kit \
|
|
--output-path docs
|
|
|
|
- uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: docs
|
|
|
|
- id: deployment
|
|
uses: actions/deploy-pages@v4
|