diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4d866a3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +{ + "name": "Awesome Java UI - Java 25", + "image": "mcr.microsoft.com/devcontainers/java:25", + "features": { + "ghcr.io/devcontainers/features/java:1": { + "version": "25", + "installMaven": "false", + "installGradle": "false" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "vscjava.vscode-java-pack", + "GitHub.copilot", + "GitHub.copilot-chat" + ], + "settings": { + "java.configuration.runtimes": [ + { + "name": "JavaSE-25", + "path": "/usr/local/sdkman/candidates/java/current" + } + ] + } + } + }, + "postCreateCommand": "bash -c 'cd /tmp && curl -Ls https://sh.jbang.dev -o jbang-install.sh && bash jbang-install.sh app setup && rm jbang-install.sh'", + "remoteUser": "vscode" +} diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a622c5d..f459c0d 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -71,6 +71,20 @@ The front matter schema: - Automatically builds and deploys to GitHub Pages on push to main - Uses JBang to run the build script in the CI environment +### Copilot Java 25 Workflow +- GitHub Actions workflow in `.github/workflows/copilot-setup-steps.yml` +- Ensures Java 25 environment for Copilot agents on pull requests +- Includes JBang setup with caching for improved performance +- Validates the build process with Java 25 +- Can be manually triggered via workflow_dispatch + +### Development Environment +- DevContainer configuration in `.devcontainer/devcontainer.json` +- Pre-configured with Java 25 for GitHub Codespaces and VS Code +- Includes GitHub Copilot extensions and Java development tools +- Automatically sets up JBang on container creation +- Provides consistent development environment across all contributors + ### Local Development - Output directory (`_site/`) is gitignored - Rebuild the site locally after markdown changes to preview diff --git a/.github/workflows/build-site.yml b/.github/workflows/build-site.yml index a754082..7efbf15 100644 --- a/.github/workflows/build-site.yml +++ b/.github/workflows/build-site.yml @@ -38,7 +38,7 @@ jobs: java-version: '25' - name: Setup JBang - uses: jbangdev/setup-jbang@main + uses: jbangdev/setup-jbang@v0.1.1 - name: Build site with JBang # this outputs to the /docs folder diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000..c485dc5 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,46 @@ +name: "Copilot Setup Steps" + +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + # This job name MUST be exactly "copilot-setup-steps" + copilot-setup-steps: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 25 + uses: actions/setup-java@v4 + with: + java-version: '25' + distribution: 'temurin' + + - name: Setup JBang + uses: jbangdev/setup-jbang@v0.1.1 + + - name: Verify Java version + run: java -version + + - name: Cache JBang dependencies + uses: actions/cache@v4 + with: + path: | + ~/.jbang + key: ${{ runner.os }}-jbang-${{ hashFiles('**/*.java') }} + restore-keys: | + ${{ runner.os }}-jbang- + + - name: Download dependencies + run: jbang run --fresh build.java diff --git a/README.md b/README.md index bbd5a57..d8d58c0 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,15 @@ Visit [https://awesome-java-ui.com](https://awesome-java-ui.com) ## Quick Start +### Option 1: GitHub Codespaces or VS Code DevContainer +The easiest way to get started is with our pre-configured development environment: + +1. Open this repository in GitHub Codespaces or VS Code with DevContainers +2. The environment will automatically set up Java 25 and JBang +3. Run `jbang run build.java` to build the site +4. Open `_site/index.html` in a browser to view the site + +### Option 2: Local Development **Prerequisites:** - Java 25+ - JBang