-
-
Notifications
You must be signed in to change notification settings - Fork 426
87 lines (75 loc) · 2.41 KB
/
test.yml
File metadata and controls
87 lines (75 loc) · 2.41 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Java CI with Maven
on:
push:
branches: [ "master" ]
tags: [ "ffmpeg-*" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
skipTests:
description: 'Skip tests during publish'
required: false
default: 'false'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: [11, 17, 21]
name: JDK ${{ matrix.java-version }}
steps:
- uses: actions/checkout@v4
- name: Set up FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
ffmpeg-version: release
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn --batch-mode verify -Dgpg.skip -DskipTests=${{ github.event.inputs.skipTests || 'false' }}
- name: Update dependency graph
if: matrix.java-version == '21' && github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: advanced-security/maven-dependency-submission-action@v4
continue-on-error: true
publish:
needs: test
# Only publish on tags (ffmpeg-*) or manual dispatch
# and only if it's not a pull request
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/ffmpeg-')) ||
(github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
environment: publish
steps:
- uses: actions/checkout@v4
- name: Set up FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
ffmpeg-version: release
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
cache: 'maven'
- name: Publish to Sonatype Central Portal
run: |
mvn clean deploy \
-DskipTests=true \
--no-transfer-progress \
-P java11plus
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}