Merge pull request #116 from CompEvol/beautipanel #227
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: CI & Publish | |
| on: | |
| push: | |
| branches: [ master ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK 25 (Azul Zulu) for GitHub Packages | |
| if: "!startsWith(github.ref, 'refs/tags/v')" | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: '25' | |
| cache: maven | |
| server-id: github | |
| server-username: GITHUB_ACTOR | |
| server-password: GITHUB_TOKEN | |
| - name: Set up JDK 25 (Azul Zulu) for Maven Central | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: '25' | |
| cache: maven | |
| server-id: central | |
| server-username: CENTRAL_USERNAME | |
| server-password: CENTRAL_TOKEN | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| gpg-passphrase: GPG_PASSPHRASE | |
| - name: Set release version from tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| echo "Publishing version: $VERSION" | |
| mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false | |
| - name: Build and test | |
| if: "!startsWith(github.ref, 'refs/tags/v')" | |
| run: mvn verify | |
| - name: Deploy all modules to GitHub Packages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| run: mvn deploy -DskipTests | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to Maven Central | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: mvn -Prelease clean deploy | |
| env: | |
| CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | |
| CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |