Bump org.apache.maven.plugins:maven-install-plugin from 3.1.1 to 3.1.… #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java CI with Maven | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: [ "ffmpeg-*" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| 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/main' | |
| 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 }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/ffmpeg-') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true |