Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e696314

Browse files
committedApr 28, 2024
feat: add centos7 for java release
Signed-off-by: zongz <zongzhe1024@163.com>
1 parent 189cc87 commit e696314

File tree

2 files changed

+80
-19
lines changed

2 files changed

+80
-19
lines changed
 

‎.github/workflows/java-test.yaml

Lines changed: 79 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: java-test
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
- master
8-
tags:
9-
- '*'
10-
pull_request:
11-
branches:
12-
- main
13-
paths:
14-
- "java/**"
15-
workflow_dispatch:
3+
on: push
4+
# push:
5+
# branches:
6+
# - main
7+
# - master
8+
# tags:
9+
# - '*'
10+
# pull_request:
11+
# branches:
12+
# - main
13+
# paths:
14+
# - "java/**"
15+
# workflow_dispatch:
1616

1717
jobs:
1818
test:
@@ -23,10 +23,6 @@ jobs:
2323
strategy:
2424
matrix:
2525
include:
26-
- os: ubuntu-latest
27-
classifier: linux-x86_64
28-
java: 8
29-
root-pom: 'pom.xml'
3026
- os: ubuntu-latest
3127
classifier: linux-aarch_64
3228
java: 8
@@ -93,12 +89,77 @@ jobs:
9389
path: |
9490
java/target/classes/native
9591
92+
build-on-centos:
93+
name: Build on CentOS 7
94+
runs-on: ubuntu-latest
95+
container:
96+
image: "centos:7"
97+
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v3
101+
102+
- name: Test and Build
103+
run: |
104+
yum makecache
105+
yum install -y centos-release-scl-rh centos-release-scl
106+
yum install -y devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-make
107+
yum install -y wget
108+
yum install -y epel-release
109+
yum install -y llvm clang llvm-devel
110+
yum install -y gcc
111+
source /opt/rh/devtoolset-10/enable
112+
gcc --version
113+
cat /etc/os-release
114+
115+
- name: Install Python 3
116+
run: |
117+
yum install -y python3 python3-devel python3-pip
118+
119+
- name: Install Rust
120+
run: |
121+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
122+
mv $HOME/.cargo/bin/* /usr/bin/
123+
rustc --version
124+
cargo --version
125+
126+
- name: Install Java and Maven
127+
run: |
128+
yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
129+
wget https://repo.huaweicloud.com/apache/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
130+
tar -xzf apache-maven-*.tar.gz
131+
mkdir p /opt/maven
132+
mv apache-maven-* /opt/maven
133+
ln -s /opt/maven/apache-maven-3.9.6/bin/mvn /usr/bin/mvn
134+
mvn --version
135+
136+
- name: Verify installed versions
137+
run: |
138+
gcc --version
139+
llvm-config --version
140+
python3 --version
141+
rustc --version
142+
mvn --version
143+
cat /etc/os-release
144+
145+
- name: 'Build and Deploy'
146+
shell: bash
147+
working-directory: java
148+
run: mvn clean package -DskipTests=true -Djni.classifier=linux-x86_64 -Dcargo-build.profile=release
149+
150+
- name: 'Upload artifact'
151+
uses: actions/upload-artifact@v3
152+
with:
153+
name: kcl-lib-linux-x86_64
154+
path: java/target/classes/native
155+
156+
96157
deploy:
97158
runs-on: ubuntu-latest
98159
permissions:
99160
contents: read
100161
packages: write
101-
needs: [ test ]
162+
needs: [ test, build-on-centos ]
102163
steps:
103164
- uses: actions/checkout@v4
104165

‎java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.kcl</groupId>
77
<artifactId>kcl-lib</artifactId>
8-
<version>0.8.5</version>
8+
<version>0.8.6-SNAPSHOT</version>
99
<name>KCL Arifact Library for Java</name>
1010
<description>
1111
KCL is an open-source constraint-based record and functional language mainly

0 commit comments

Comments
 (0)