Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ jobs:
if: github.ref_name == github.event.repository.default_branch
run: ./gradlew publishAllPublicationsToStagingRepository

- name: Add bootstrap.sh to GitHub Pages artifact
- name: Add bootstrap scripts to GitHub Pages artifact
if: github.ref_name == github.event.repository.default_branch
run: cp ./scripts/bootstrap.sh ./build/staging-maven-repository/bootstrap.sh
run: |
cp ./scripts/bootstrap.sh ./build/staging-maven-repository/bootstrap.sh
cp ./scripts/bootstrap.ps1 ./build/staging-maven-repository/bootstrap.ps1

- name: Upload GitHub Pages artifact
if: github.ref_name == github.event.repository.default_branch
Expand Down
74 changes: 67 additions & 7 deletions .github/workflows/verify-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ permissions:
packages: read

jobs:
verify:
name: Verify template builds
verify-linux:
name: Verify template builds (Linux)
runs-on: ubuntu-latest
timeout-minutes: 20

Expand Down Expand Up @@ -53,25 +53,85 @@ jobs:
VENDOR_PASSWORD: ${{ secrets.VENDOR_PASSWORD }}

- name: Create project from template
run: ./scripts/bootstrap.sh /tmp/cinpo-verify-project
run: ./scripts/bootstrap.sh "${{ runner.temp }}/cinpo-verify-project"

- name: Prepare vendor files
run: cp -a vendor /tmp/cinpo-verify-project/vendor
run: cp -a vendor "${{ runner.temp }}/cinpo-verify-project/vendor"

- name: Verify cinpoRun
working-directory: /tmp/cinpo-verify-project
working-directory: ${{ runner.temp }}/cinpo-verify-project
run: ./gradlew --no-daemon --refresh-dependencies cinpoRun --args='--debug --test'
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

- name: Build cinpoJar
working-directory: /tmp/cinpo-verify-project
working-directory: ${{ runner.temp }}/cinpo-verify-project
run: ./gradlew --no-daemon cinpoJar
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

- name: Verify cinpoJar appliance
working-directory: /tmp/cinpo-verify-project
working-directory: ${{ runner.temp }}/cinpo-verify-project
run: java -jar build/libs/cinpo-appliance.jar write --test

verify-windows:
name: Verify template builds (Windows)
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: pwsh

steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Configure GitHub auth for standalone template fetches
run: git config --global url."https://x-access-token:$env:GH_TOKEN@github.com/".insteadOf "https://github.com/"
env:
GH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

# No chmod: Windows has no POSIX execute bit, and gradlew.bat needs none.
- name: Extract vendor archives
run: .\scripts\extract_vendor.ps1
env:
VENDOR_PASSWORD: ${{ secrets.VENDOR_PASSWORD }}

- name: Create project from template
run: .\scripts\bootstrap.ps1 "${{ runner.temp }}\cinpo-verify-project"

- name: Prepare vendor files
run: Copy-Item -Recurse -Force vendor "${{ runner.temp }}\cinpo-verify-project\vendor"

# The backslash Windows path in --profile also exercises the CinpoRunTask
# argument tokenizer, which used to collapse "C:\Users\..." to "C:Users...".
- name: Verify cinpoRun
working-directory: ${{ runner.temp }}\cinpo-verify-project
run: .\gradlew.bat --no-daemon --refresh-dependencies cinpoRun --args="--debug --profile=${{ runner.temp }}\cinpo-verify-project\profile\jcdksim.yaml --test"
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

- name: Build cinpoJar
working-directory: ${{ runner.temp }}\cinpo-verify-project
run: .\gradlew.bat --no-daemon cinpoJar
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

- name: Verify cinpoJar appliance
working-directory: ${{ runner.temp }}\cinpo-verify-project
run: java -jar build\libs\cinpo-appliance.jar write --test
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ If you already have a checkout of this repository, you can run the script locall
bash ./scripts/bootstrap.sh my-project
```

On Windows, use [`scripts/bootstrap.ps1`](scripts/bootstrap.ps1). It is a port of the same
four phases and only requires `git`:

```powershell
# From a checkout
powershell -ExecutionPolicy Bypass -File .\scripts\bootstrap.ps1 my-project

# Without cloning
irm https://AokiApp.github.io/cinpo/bootstrap.ps1 -OutFile bootstrap.ps1
powershell -ExecutionPolicy Bypass -File .\bootstrap.ps1 my-project
```

Both scripts accept `--template`/`-Template` and `--name`/`-Name`. The generated project is
identical either way: the PowerShell version checks the template out with `core.autocrlf=false`
and marks `gradlew` executable in the Git index, so a project created on Windows still builds
on Linux.

This creates a standalone starter project that you can customize manually. If you prefer, you can still copy [`template/`](template) yourself. The starter is intentionally small: a single Hello applet plus one provision task that issues and writes a leaf certificate, and one test task that reads it back.

```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'app.aoki.cinpo'
version = '0.3.2'
version = '0.3.3'

java {
toolchain {
Expand Down
Loading