Skip to content

Commit 6a36587

Browse files
authored
Merge pull request #66 from zong-zhe/release-centos-java
feat: add centos7 for java release
2 parents 1646bb6 + aa86fbe commit 6a36587

File tree

2 files changed

+67
-6
lines changed

2 files changed

+67
-6
lines changed

.github/workflows/java-test.yaml

+66-5
Original file line numberDiff line numberDiff line change
@@ -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

+1-1
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)