🚀 Release #15
Workflow file for this run
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: 🚀 Maven Library Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🧩 Checkout repo | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: ☕ Setup JDK 25 (Temurin) | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 25 | |
| cache: maven | |
| server-id: ossrh | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_PASSWORD | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: GPG_PASSPHRASE | |
| - name: ⚙️ Install Task CLI | |
| run: | | |
| echo "🛠 Installing Task CLI..." | |
| sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d | |
| sudo mv ./bin/task /usr/local/bin/task | |
| task --version | |
| - name: 🔧 Build project | |
| run: task build | |
| - name: 🧪 Run tests with coverage check (min 60% - temporary without testing real GraalVM context) | |
| run: | | |
| mvn clean verify org.jacoco:jacoco-maven-plugin:prepare-agent org.jacoco:jacoco-maven-plugin:report | |
| COVERED=$(grep -A 1 '<counter type="INSTRUCTION"' target/site/jacoco/jacoco.xml | grep -oP 'covered="\K[0-9]+' | awk '{s+=$1} END{print s}') | |
| MISSED=$(grep -A 1 '<counter type="INSTRUCTION"' target/site/jacoco/jacoco.xml | grep -oP 'missed="\K[0-9]+' | awk '{s+=$1} END{print s}') | |
| TOTAL=$((COVERED + MISSED)) | |
| PERCENT=$((100 * COVERED / TOTAL)) | |
| echo "➡️ Code Coverage: ${PERCENT}%" | |
| if [ "$PERCENT" -lt 60 ]; then | |
| echo "❌ Coverage below 60%! (${PERCENT}%)" | |
| exit 1 | |
| fi | |
| - name: 📦 Collect JAR artifacts | |
| run: | | |
| mkdir -p release-artifacts | |
| find . -type f -name "*.jar" ! -name "original-*.jar" -exec cp {} release-artifacts/ \; | |
| ls -la release-artifacts | |
| - name: 🏷️ Create GitHub Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| artifacts: "release-artifacts/*.jar" | |
| artifactContentType: application/java-archive | |
| body: | | |
| 🚀 **Maven Library Release** | |
| Built automatically from tag `${{ github.ref_name }}` | |
| ✅ Includes compiled JAR artifacts. | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: ☁️ Deploy to Maven Central | |
| if: success() | |
| run: | | |
| mvn clean deploy -P release --batch-mode -Dgpg.skip=false -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" |