52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
on:
|
|
workflow_call:
|
|
inputs:
|
|
maven-version:
|
|
required: true
|
|
type: string
|
|
java-version:
|
|
required: true
|
|
type: string
|
|
artifact-name:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
build_java_project:
|
|
runs-on: ubuntu_act_on_20
|
|
# container:
|
|
# image: catthehacker/ubuntu:act-latest
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Maven
|
|
uses: stCarolas/setup-maven@v5
|
|
with:
|
|
maven-version: ${{ inputs.maven-version }}
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '${{ inputs.java-version }}'
|
|
# cache: 'maven'
|
|
|
|
- name: Cache local Maven repository
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-maven-
|
|
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
# restore-keys: |
|
|
# ${{ runner.os }}-maven-
|
|
|
|
- name: Build with Maven
|
|
run: mvn --batch-mode package --file pom.xml -Dhttps.proxyHost=act_clash -Dhttps.proxyPort=7890 -Dhttp.proxyHost=act_clash -Dhttp.proxyPort=7890
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ inputs.artifact-name }}
|
|
path: |
|
|
target
|
|
src/main/docker |