-
-
Notifications
You must be signed in to change notification settings - Fork 426
106 lines (90 loc) · 2.74 KB
/
release.yml
File metadata and controls
106 lines (90 loc) · 2.74 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release
on:
push:
tags: [ "ffmpeg-*" ]
workflow_dispatch:
jobs:
test:
# Only run tests on tag push (manual dispatch skips to javadoc)
if: github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: [11, 17, 21]
name: JDK ${{ matrix.java-version }}
steps:
- uses: actions/checkout@v6
- name: Set up FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
with:
ffmpeg-version: release
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Test with Maven
run: mvn --batch-mode verify -Dgpg.skip
publish:
needs: test
if: github.event_name == 'push'
runs-on: ubuntu-latest
environment: publish
steps:
- uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v5
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 \
-Dgpg.skip=false
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
javadoc:
needs: [test, publish]
# Run even when test/publish are skipped (manual dispatch)
if: always() && !failure() && !cancelled()
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Generate Javadoc
run: mvn javadoc:javadoc --no-transfer-progress -Dgpg.skip
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: target/reports/apidocs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5