Skip to content
This repository was archived by the owner on Dec 29, 2025. It is now read-only.

Commit dbbed0e

Browse files
authored
Create build.yml
1 parent 8d58b1c commit dbbed0e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build Maven Java 21
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: '17'
22+
23+
- name: Cache Maven packages
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.m2
27+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28+
restore-keys: |
29+
${{ runner.os }}-maven-
30+
31+
- name: Build with Maven
32+
run: mvn clean package -B
33+
34+
- name: Rename JAR file
35+
run: |
36+
JAR_FILE=$(ls target/*.jar | head -n 1)
37+
cp "$JAR_FILE" "jsEngine#${{ github.run_number }}.jar"
38+
39+
- name: Upload JAR artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: jsEngine#${{ github.run_number }}
43+
path: jsEngine#${{ github.run_number }}.jar
44+

0 commit comments

Comments
 (0)