Skip to content

Commit

Permalink
Updates the CI settings (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiwakaba authored Oct 23, 2024
1 parent d5a8a30 commit 682f582
Show file tree
Hide file tree
Showing 44 changed files with 954 additions and 802 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/cron.yaml

This file was deleted.

102 changes: 66 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: K2hdkc Java CI

on:
# Trigger the workflow on push or pull request,
Expand All @@ -19,41 +19,71 @@ jobs:
build:

if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]') && ! contains(toJSON(github.event.commits.*.message), '[ci skip]')"

runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11', '17', '21' ]

name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
server-id: ossrh
settings-path: ${{ github.workspace }}
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable of GPG private key passphrase

- name: Install dependent packages, build package and run tests
run: mvn -B clean exec:exec package

- name: Upload a jar file to asset
if: github.event_name == 'release'
run: mvn -B exec:exec -Pupload
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Deploy the docs to github
if: github.event_name == 'release'
run: mvn -B site -s settings_github.xml
env:
GITPAGES_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKE_FOR_GITPAGES }}

- name: Publish to Apache Maven Central
if: github.event_name == 'release'
run: mvn -B deploy -Prelease -s $GITHUB_WORKSPACE/settings.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
server-id: ossrh
settings-path: ${{ github.workspace }}
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable of GPG private key passphrase

- name: Set environments
run: |
echo "COMMON_MAVEN_OPTS=-Dmaven.compiler.failOnWarning=true -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.verbose=true -Dmaven.compiler.debuglevel=lines,vars,source" >> "$GITHUB_ENV"
- name: Install dependent packages
run: |
sudo apt-get install -y curl
curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.deb.sh | sudo bash
sudo apt-get install -y k2hdkc-dev
- name: Run checkstyle
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} checkstyle:check
- name: Run chmpx and k2hdkc
run: |
sh ./cluster/start_server.sh
- name: Run package on version 8
if: "matrix.java == '8'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} -Dmaven.compiler.target=8 package
- name: Run package on version other than 8
if: "matrix.java != '8'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.release=${{ matrix.java }} package
- name: Run javadoc
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} javadoc:javadoc
- name: Deploy the docs to github
if: "github.event_name == 'release' && matrix.java == '21'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} site -s settings_github.xml
env:
GITPAGES_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKE_FOR_GITPAGES }}

- name: Publish to Apache Maven Central
if: "github.event_name == 'release' && matrix.java == '21'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} deploy -Prelease -s $GITHUB_WORKSPACE/settings.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
139 changes: 0 additions & 139 deletions .github/workflows/upload.sh

This file was deleted.

8 changes: 0 additions & 8 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
k2hdkc-java (1.1.8) stable; urgency=low

* Adds the release profile for Maven Central
* Uses JUnit5
* Uses JDK17

-- Hirotaka Wakabayashi <[email protected]> Mon, 11 Oct 2021 05:49:50 +0000

k2hdkc-java (1.1.7) stable; urgency=low

* Updates setup-java 1.4.3
Expand Down
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,6 @@ Clone this repository and go into the directory, then run the following command.
$ mvn clean exec:exec package
```

#### JDK

You can try a new JDK by changing the JAVA_HOME environment and run `mvn clean exec:exec package`.
```
$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el7_9.x86_64
$ mvn clean exec:exec package
```

#### Update outdated dependency libraries

Run the following command to find outdated dependency libraries.
```
$ mvn versions:display-plugin-updates
$ mvn versions:display-dependency-updates
```
Then, you should replace the outdated versions with the newer ones in the pom.xml.

### Documents
- [Document top page](https://java.k2hdkc.antpick.ax/)
- [API Document page](https://java.k2hdkc.antpick.ax/apidocs/index.html)
Expand Down
11 changes: 3 additions & 8 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<module name = "Checker">
<property name="charset" value="UTF-8"/>

<property name="severity" value="warning"/>

<property name="fileExtensions" value="java, properties, xml"/>
<!-- Checks for whitespace -->
<!-- See https://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>

<module name="LineLength">
<property name="max" value="120"/>
</module>
</module>
Loading

0 comments on commit 682f582

Please sign in to comment.