From 89e830818a81e3362fee92fb5f3280ae4ad665df Mon Sep 17 00:00:00 2001 From: sttk Date: Sat, 11 Apr 2026 01:49:37 +0900 Subject: [PATCH] cicd: added configuration files of github actions --- .github/workflows/java-ci.yml | 29 +++++++++++++++++++++++++ .github/workflows/javadoc.yml | 26 ++++++++++++++++++++++ .github/workflows/publish.yml | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 .github/workflows/java-ci.yml create mode 100644 .github/workflows/javadoc.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/java-ci.yml b/.github/workflows/java-ci.yml new file mode 100644 index 0000000..dbbeb3d --- /dev/null +++ b/.github/workflows/java-ci.yml @@ -0,0 +1,29 @@ +name: Java CI + +on: + push: + branches: [ '*', '*/*' ] + +jobs: + build: + name: Build for GraalVM (OpenJDK ${{ matrix.javaver }}) on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + javaver: [21, 23, 24, 25] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v6 + - name: GitHub Action for GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: ${{ matrix.javaver }} + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} + native-image-job-reports: 'true' + - run: docker compose -f env/standalone-docker/docker-compose.yml up -d + - name: Build and test + run: mvn package + - name: Native test + run: mvn -Pnative test diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml new file mode 100644 index 0000000..da3cecf --- /dev/null +++ b/.github/workflows/javadoc.yml @@ -0,0 +1,26 @@ +name: Javadoc + +on: + release: + types: [ created ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: GitHub Action for GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: 25 + distribution: 'graalvm' + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Compile + run: mvn compile + - name: Javadoc + run: mvn javadoc:javadoc + - name: Publish Documentation on GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./target/site/apidocs diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2d65a1f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish package to the Maven Central Repository + +on: + release: + types: [ created ] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v6 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: 21 + + - name: Build with Maven + run: mvn -ntp -B package + + - name: Set up Maven Central Repository + uses: actions/setup-java@v5 + with: + java-version: 21 + distribution: 'temurin' + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.CENTRAL_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Publish to the Maven Central Repository + run: mvn -ntp -B -DskipTests -Prelease-central deploy + env: + MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.CENTRAL_GPG_PASS_PHRASE }}