Skip to content

Commit 60e5719

Browse files
committed
Enhance Maven site deployment and documentation
- Update GitHub Actions workflow to build and deploy Maven site to GitHub Pages. - Modify README.md to reference the correct image path and update documentation link. - Add Maven Antrun plugin to copy README.md and images to the site directory. - Introduce Maven Site Plugin for improved site generation. - Create new documentation file (DOCS.md) with detailed API reference and usage examples. - Add .gitignore for site markdown resources. - Include site.xml for Maven site configuration.
1 parent e9ff597 commit 60e5719

7 files changed

Lines changed: 161 additions & 25 deletions

File tree

‎.github/workflows/site.yml‎

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
2+
name: Deploy Maven Site to Pages
33

44
on:
55
# Runs on pushes targeting the default branch
@@ -22,22 +22,40 @@ concurrency:
2222
cancel-in-progress: false
2323

2424
jobs:
25-
# Single deploy job since we're just deploying
26-
deploy:
27-
environment:
28-
name: github-pages
29-
url: ${{ steps.deployment.outputs.page_url }}
25+
# Build Maven Site
26+
build:
3027
runs-on: ubuntu-latest
3128
steps:
3229
- name: Checkout
3330
uses: actions/checkout@v4
31+
32+
- name: Set up JDK 17
33+
uses: actions/setup-java@v4
34+
with:
35+
java-version: '17'
36+
distribution: 'temurin'
37+
cache: maven
38+
39+
- name: Build Maven Site with Javadoc
40+
run: ./mvnw site -DskipTests -Dcheckstyle.skip=true
41+
3442
- name: Setup Pages
3543
uses: actions/configure-pages@v5
44+
3645
- name: Upload artifact
3746
uses: actions/upload-pages-artifact@v3
3847
with:
39-
# Upload entire repository
40-
path: '.'
48+
# Upload the generated site
49+
path: 'target/site'
50+
51+
# Deploy to GitHub Pages
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
4159
- name: Deploy to GitHub Pages
4260
id: deployment
4361
uses: actions/deploy-pages@v4

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Java SDK for programmatic control of GitHub Copilot CLI.
1010
> **Note:** This SDK may change in breaking ways.
1111
1212
<p align="center">
13-
<img src="image.png" alt="Copilot SDK for Java" />
13+
<img src="src/site/resources/image.png" alt="Copilot SDK for Java" />
1414
</p>
1515

1616
## Table of Contents
@@ -122,7 +122,7 @@ The `jbang-example.java` file includes the dependency declaration and can be run
122122

123123
## Documentation
124124

125-
For detailed API reference and advanced usage examples, see [DOCS.md](DOCS.md).
125+
For detailed API reference and advanced usage examples, see the [Documentation](src/site/markdown/docs.md).
126126

127127
## Building and Testing
128128

‎pom.xml‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,37 @@
7878
<artifactId>maven-compiler-plugin</artifactId>
7979
<version>3.14.1</version>
8080
</plugin>
81+
<!-- Copy README.md and images to site directory -->
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-antrun-plugin</artifactId>
85+
<version>3.1.0</version>
86+
<executions>
87+
<execution>
88+
<id>copy-docs-to-site</id>
89+
<phase>pre-site</phase>
90+
<goals>
91+
<goal>run</goal>
92+
</goals>
93+
<configuration>
94+
<target>
95+
<copy file="${project.basedir}/README.md"
96+
tofile="${project.basedir}/src/site/markdown/index.md"/>
97+
<!-- Copy images referenced in README.md to site root -->
98+
<mkdir dir="${project.basedir}/src/site/resources"/>
99+
<copy todir="${project.basedir}/src/site/resources">
100+
<fileset dir="${project.basedir}">
101+
<include name="*.png"/>
102+
<include name="*.jpg"/>
103+
<include name="*.gif"/>
104+
<include name="*.svg"/>
105+
</fileset>
106+
</copy>
107+
</target>
108+
</configuration>
109+
</execution>
110+
</executions>
111+
</plugin>
81112
<!-- Clone the official copilot-sdk repository for test resources -->
82113
<plugin>
83114
<groupId>org.codehaus.mojo</groupId>
@@ -178,9 +209,45 @@
178209
</dependency>
179210
</dependencies>
180211
</plugin>
212+
<!-- Maven Site Plugin -->
213+
<plugin>
214+
<groupId>org.apache.maven.plugins</groupId>
215+
<artifactId>maven-site-plugin</artifactId>
216+
<version>4.0.0-M16</version>
217+
</plugin>
181218
</plugins>
182219
</build>
183220

221+
<!-- Reporting plugins for Maven Site -->
222+
<reporting>
223+
<plugins>
224+
<!-- Project Info Reports -->
225+
<plugin>
226+
<groupId>org.apache.maven.plugins</groupId>
227+
<artifactId>maven-project-info-reports-plugin</artifactId>
228+
<version>3.9.0</version>
229+
</plugin>
230+
<!-- Javadoc -->
231+
<plugin>
232+
<groupId>org.apache.maven.plugins</groupId>
233+
<artifactId>maven-javadoc-plugin</artifactId>
234+
<version>3.12.0</version>
235+
<configuration>
236+
<show>public</show>
237+
<nohelp>true</nohelp>
238+
<doclint>none</doclint>
239+
</configuration>
240+
<reportSets>
241+
<reportSet>
242+
<reports>
243+
<report>javadoc</report>
244+
</reports>
245+
</reportSet>
246+
</reportSets>
247+
</plugin>
248+
</plugins>
249+
</reporting>
250+
184251
<profiles>
185252
<profile>
186253
<id>release</id>

‎src/site/markdown/.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copied from root during pre-site phase - do not edit here
2+
index.md

DOCS.md renamed to src/site/markdown/DOCS.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ This document provides detailed API reference and usage examples for the Copilot
44

55
## Table of Contents
66

7-
- [API Reference](#api-reference)
8-
- [CopilotClient](#copilotclient)
9-
- [CopilotSession](#copilotsession)
10-
- [Event Types](#event-types)
11-
- [Streaming](#streaming)
12-
- [Listing Models](#listing-models)
13-
- [Advanced Usage](#advanced-usage)
14-
- [Manual Server Control](#manual-server-control)
15-
- [Tools](#tools)
16-
- [System Message Customization](#system-message-customization)
17-
- [Multiple Sessions](#multiple-sessions)
18-
- [File Attachments](#file-attachments)
19-
- [Bring Your Own Key (BYOK)](#bring-your-own-key-byok)
20-
- [Permission Handling](#permission-handling)
21-
- [Error Handling](#error-handling)
7+
- [API Reference](#API_Reference)
8+
- [CopilotClient](#CopilotClient)
9+
- [CopilotSession](#CopilotSession)
10+
- [Event Types](#Event_Types)
11+
- [Streaming](#Streaming)
12+
- [Listing Models](#Listing_Models)
13+
- [Advanced Usage](#Advanced_Usage)
14+
- [Manual Server Control](#Manual_Server_Control)
15+
- [Tools](#Tools)
16+
- [System Message Customization](#System_Message_Customization)
17+
- [Multiple Sessions](#Multiple_Sessions)
18+
- [File Attachments](#File_Attachments)
19+
- [Bring Your Own Key (BYOK)](#Bring_Your_Own_Key_.28BYOK.29)
20+
- [Permission Handling](#Permission_Handling)
21+
- [Error Handling](#Error_Handling)
2222

2323
## API Reference
2424

File renamed without changes.

‎src/site/site.xml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright (c) Microsoft Corporation. All rights reserved.
4+
-->
5+
<project xmlns="http://maven.apache.org/DECORATION/1.8.0"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 https://maven.apache.org/xsd/decoration-1.8.0.xsd"
8+
name="GitHub Copilot Community SDK :: Java">
9+
10+
<skin>
11+
<groupId>org.apache.maven.skins</groupId>
12+
<artifactId>maven-fluido-skin</artifactId>
13+
<version>2.0.0-M11</version>
14+
</skin>
15+
16+
<body>
17+
<breadcrumbs>
18+
<item name="Home" href="index.html"/>
19+
</breadcrumbs>
20+
21+
<menu name="Overview">
22+
<item name="Introduction" href="index.html"/>
23+
<item name="Documentation" href="docs.html"/>
24+
</menu>
25+
26+
<menu name="Documentation">
27+
<item name="API Reference" href="docs.html#API_Reference">
28+
<item name="CopilotClient" href="docs.html#CopilotClient"/>
29+
<item name="CopilotSession" href="docs.html#CopilotSession"/>
30+
</item>
31+
<item name="Event Types" href="docs.html#Event_Types"/>
32+
<item name="Streaming" href="docs.html#Streaming"/>
33+
<item name="Listing Models" href="docs.html#Listing_Models"/>
34+
<item name="Advanced Usage" href="docs.html#Advanced_Usage">
35+
<item name="Manual Server Control" href="docs.html#Manual_Server_Control"/>
36+
<item name="Tools" href="docs.html#Tools"/>
37+
<item name="System Message Customization" href="docs.html#System_Message_Customization"/>
38+
<item name="Multiple Sessions" href="docs.html#Multiple_Sessions"/>
39+
<item name="File Attachments" href="docs.html#File_Attachments"/>
40+
<item name="Bring Your Own Key (BYOK)" href="docs.html#Bring_Your_Own_Key_.28BYOK.29"/>
41+
<item name="Permission Handling" href="docs.html#Permission_Handling"/>
42+
</item>
43+
<item name="Error Handling" href="docs.html#Error_Handling"/>
44+
</menu>
45+
46+
<menu ref="reports"/>
47+
48+
</body>
49+
</project>

0 commit comments

Comments
 (0)