Skip to content

Commit 8d82c39

Browse files
authored
chore: created build environment (#1)
1 parent bed4221 commit 8d82c39

File tree

12 files changed

+580
-0
lines changed

12 files changed

+580
-0
lines changed

.gitattribute

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/java-ci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Java CI
2+
3+
on:
4+
push:
5+
branches: [ '*', '*/*' ]
6+
7+
jobs:
8+
build:
9+
name: Build for GraalVM (OpenJDK ${{ matrix.javaver }}) on ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
javaver: [21]
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: GitHub Action for GraalVM
19+
uses: graalvm/setup-graalvm@v1
20+
with:
21+
java-version: ${{ matrix.javaver }}
22+
distribution: 'graalvm'
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
native-image-job-reports: 'true'
25+
- name: Build and test
26+
run: mvn package
27+
- name: Test with trace agent
28+
run: mvn -Ptrace test
29+
- name: Native test
30+
run: mvn -Pnative test

.github/workflows/javadoc.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Javadoc
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: GitHub Action for GraalVM
13+
uses: graalvm/setup-graalvm@v1
14+
with:
15+
java-version: 21
16+
distribution: 'graalvm'
17+
github_token: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Compile
19+
run: mvn compile
20+
- name: Javadoc
21+
run: mvn javadoc:javadoc
22+
- name: Publish Documentation on GitHub Pages
23+
uses: peaceiris/actions-gh-pages@v3
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: ./target/site/apidocs

.github/workflows/publish.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish package to the Maven Central Repository and GitHub Packages
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up JDK
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: 21
21+
- name: Build with Maven
22+
run: mvn -ntp -B package
23+
- name: Publish to GitHub Packages
24+
run: mvn -ntp -B -DskipTests -Prelease-gh deploy
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Set up Maven Central Repository
29+
uses: actions/setup-java@v4
30+
with:
31+
java-version: '21'
32+
distribution: 'temurin'
33+
server-id: ossrh
34+
server-username: MAVEN_USERNAME
35+
server-password: MAVEN_PASSWORD
36+
gpg-private-key: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
37+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
38+
- name: Publish to the Maven Central Repository
39+
run: |
40+
mvn -ntp -B -DskipTests -Prelease-ossrh deploy
41+
env:
42+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
43+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
44+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Java
2+
*.class
3+
*.jar
4+
*.war
5+
*.ear
6+
hs_err_pid*
7+
8+
# Directories
9+
target/
10+
test-results-native/
11+
12+
# OS generating files
13+
.DS_Store
14+
Thumbs.db
15+
16+
# GraalVM native build configuration files
17+
src/main/resources/META-INF/native-image

.gitmessage.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
########50 characters############################
4+
## Prefix examples:
5+
#
6+
# new: a new feature
7+
# fix: a bug fix
8+
# update: a slight change
9+
# merge: merge pull request
10+
# style: only code style changes
11+
# comment: only comment changes
12+
# refactor: code changes that do not affect the behavior
13+
# perf: a code change that improves performance
14+
# deps: bump deps used on compiling or runtime
15+
# test: update test files
16+
# cicd: update CI/CD confguration files.
17+
# doc: documentation only changes
18+
# wip: work in progress
19+
# chore: bump test deps, modify build files, etc

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Takayuki Sato
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

build.sh

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env bash
2+
3+
errcheck() {
4+
exitcd=$1
5+
if [[ "$exitcd" != "0" ]]; then
6+
exit $exitcd
7+
fi
8+
}
9+
10+
clean() {
11+
mvn clean
12+
errcheck $?
13+
}
14+
15+
compile() {
16+
mvn compile
17+
errcheck $?
18+
}
19+
20+
test() {
21+
mvn test
22+
errcheck $?
23+
}
24+
25+
jar() {
26+
mvn package
27+
errcheck $?
28+
}
29+
30+
javadoc() {
31+
mvn javadoc:javadoc
32+
errcheck $?
33+
}
34+
35+
deps() {
36+
mvn versions:display-dependency-updates
37+
errcheck $?
38+
}
39+
40+
sver() {
41+
serialver -classpath target/classes $1
42+
errcheck $?
43+
}
44+
45+
trace_test() {
46+
mvn -Ptrace test
47+
errcheck $?
48+
}
49+
50+
native_test() {
51+
mvn -Pnative test
52+
errcheck $?
53+
}
54+
55+
deploy() {
56+
mvn deploy
57+
errcheck $?
58+
}
59+
60+
61+
if [[ "$#" == "0" ]]; then
62+
clean
63+
jar
64+
javadoc
65+
trace_test
66+
native_test
67+
else
68+
for a in "$@"; do
69+
case "$a" in
70+
clean)
71+
clean
72+
;;
73+
compile)
74+
compile
75+
;;
76+
test)
77+
test
78+
;;
79+
jar)
80+
jar
81+
;;
82+
javadoc)
83+
javadoc
84+
;;
85+
deps)
86+
deps
87+
;;
88+
sver)
89+
sver $2
90+
;;
91+
'trace-test')
92+
trace_test
93+
;;
94+
'native-test')
95+
native_test
96+
;;
97+
deploy)
98+
deploy
99+
;;
100+
*)
101+
echo "Bad task: $a"
102+
exit 1
103+
;;
104+
esac
105+
done
106+
fi
107+

0 commit comments

Comments
 (0)