name: "Update API Reference" on: workflow_dispatch: inputs: sourceRef: description: "Sparkle source branch or tag to checkout" required: true default: "2.x" concurrency: group: update-repo-${{ github.ref }} cancel-in-progress: false jobs: api-documentation: name: "Update API Reference Documentation" runs-on: macos-13 steps: - name: "Set up Ruby" uses: ruby/setup-ruby@v1 with: ruby-version: 3.2.2 - name: "Set up jazzy" run: | gem install jazzy - name: "Checkout Sparkle Sources" uses: actions/checkout@v4 with: repository: 'sparkle-project/Sparkle' token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }} submodules: true ref: ${{ github.event.inputs.sourceRef }} fetch-depth: 0 path: 'sparkle-source' - name: "Checkout Website Sources" uses: actions/checkout@v4 with: token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }} fetch-depth: 0 path: 'sparkle-website' - name: "Create Documentation Files" run: | cd "$GITHUB_WORKSPACE/sparkle-source" make docs - name: "Copy Documentation Files" run: | cd "$GITHUB_WORKSPACE/sparkle-website" rm -rf "documentation/api-reference" cp -R "$GITHUB_WORKSPACE/sparkle-source/Documentation/html" "documentation/api-reference" - name: "Commit and Push Changes" env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_TOKEN: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }} run: | cd "$GITHUB_WORKSPACE/sparkle-website" git config user.name Sparkle-Bot git config user.email sparkle.project.bot@gmail.com git add "documentation/api-reference" git commit -m "Update API documentation" git push