Repository navigation
63 lines (61 loc) · 2.12 KB
/
Copy pathmaven.yml
File metadata and controls
63 lines (61 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Build and Deploy the main branch
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
skip_docker:
description: Skip Docker Hub login and image push
type: boolean
default: false
skip_github:
description: Skip GitHub SNAPSHOT pre-release
type: boolean
default: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
env:
SKIP_DOCKER: ${{ inputs.skip_docker == 'true' }}
SKIP_GITHUB: ${{ inputs.skip_github == 'true' }}
steps:
- uses: actions/checkout@v7
- name: Fetch origin/main for Spotless ratchet
run: git fetch origin main --depth=1
- name: Set up JDK 21
uses: actions/setup-java@v6
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Cache Docker images
if: env.SKIP_DOCKER != 'true'
uses: AndreKurait/[email protected]
with:
key: fscrawler-docker-cache-${{ runner.os }}-${{ hashFiles('pom.xml') }}
continue-on-error: true
- name: Login to Docker Hub
if: env.SKIP_DOCKER != 'true'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create Maven settings.xml
if: env.SKIP_DOCKER != 'true'
uses: s4u/[email protected]
with:
githubServer: false
servers: '[{"id": "docker.io", "username": "${{ secrets.DOCKER_USERNAME }}", "password": "${{ secrets.DOCKER_PASSWORD }}"}]'
- name: Build SNAPSHOT ZIP
if: env.SKIP_DOCKER == 'true'
run: mvn --batch-mode package -DskipTests -Dossindex.skip -Ddocker.skip
- name: Build SNAPSHOT ZIP and deploy Docker images
if: env.SKIP_DOCKER != 'true'
run: mvn --batch-mode deploy -DskipTests -Dossindex.skip
- name: Publish SNAPSHOT ZIP as GitHub pre-release
if: env.SKIP_GITHUB != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python3 scripts/publish_snapshot_prerelease.py