Skip to content

chore: release 1.2.0 — strip SNAPSHOT, update README version #6

chore: release 1.2.0 — strip SNAPSHOT, update README version

chore: release 1.2.0 — strip SNAPSHOT, update README version #6

Workflow file for this run

name: Publish
on:
push:
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: '17'
distribution: temurin
cache: maven
- name: Build
run: mvn --batch-mode -DskipTests -Dmaven.javadoc.skip=true package
- uses: actions/upload-artifact@v7
with: { name: jars, path: target/*.jar }
test:
name: Test (JDK ${{ matrix.java-version }})
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: ['17', '21']
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: temurin
cache: maven
- name: Test
run: mvn --batch-mode verify -Dmaven.javadoc.skip=true
- uses: actions/upload-artifact@v7
if: matrix.java-version == '17'
with:
name: jacoco-report
path: target/site/jacoco/jacoco.xml
if-no-files-found: ignore
publish-snapshot:
name: Publish Snapshot to Central
needs: [test]
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
environment: maven-central
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: '17'
distribution: temurin
cache: maven
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy snapshot
run: mvn --batch-mode deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
publish-release:
name: Publish Release to Central
needs: [test]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment: maven-central
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: '17'
distribution: temurin
cache: maven
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Deploy release
run: mvn --batch-mode -P release deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
post-publish:
name: Post-Publish
needs: [test, publish-snapshot, publish-release]
if: >-
always() &&
needs.test.result == 'success' &&
(needs.publish-snapshot.result == 'success' ||
needs.publish-release.result == 'success')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with: { java-version: '17', distribution: temurin, cache: maven }
- uses: actions/download-artifact@v8
with: { name: jacoco-report, path: target/site/jacoco/ }
continue-on-error: true
- uses: advanced-security/maven-dependency-submission-action@v5
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/site/jacoco/jacoco.xml
continue-on-error: true
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_TOKEN }}
file: target/site/jacoco/jacoco.xml
format: jacoco
continue-on-error: true
- name: Run PIT mutation tests
run: mvn --batch-mode test-compile org.pitest:pitest-maven:mutationCoverage -Dmaven.javadoc.skip=true
- name: Extract PIT survivors
if: always()
run: |
echo "=== PIT Survived Mutations ==="
for html_file in $(find target/pit-reports -name "*.html" -type f | sort); do
if grep -q "SURVIVED" "$html_file"; then
echo "Found survivors in $html_file:"
grep -B 2 -A 3 "SURVIVED" "$html_file"
echo ""
fi
done
- uses: actions/upload-artifact@v7
if: always()
with: { name: pit-reports, path: target/pit-reports/ }