|
| 1 | +name: Publish emoji to Maven Central |
| 2 | + |
| 3 | +# Publishes the graph-compose-emoji companion artifact to Maven Central, |
| 4 | +# independently of the engine. The bundled Noto Emoji glyphs change rarely, so |
| 5 | +# they release on their OWN tag line (emoji-v*) — pushing an engine v* tag |
| 6 | +# never touches them, and re-publishing emoji does not require an engine |
| 7 | +# release. This mirrors publish-fonts.yml but targets emoji/pom.xml. |
| 8 | +# |
| 9 | +# Tagging: emoji-vX.Y.Z (e.g. emoji-v1.0.0). The emoji artifact carries its |
| 10 | +# own independent version (see emoji/pom.xml) — keep it in sync with the tag. |
| 11 | +# |
| 12 | +# Human prerequisites are identical to publish.yml (GPG key + Central token |
| 13 | +# secrets). See docs/contributing/release-process.md for the runbook. |
| 14 | + |
| 15 | +on: |
| 16 | + push: |
| 17 | + tags: |
| 18 | + - 'emoji-v*' |
| 19 | + workflow_dispatch: |
| 20 | + inputs: |
| 21 | + tag: |
| 22 | + description: 'Existing emoji-v*-prefixed tag to (re-)publish' |
| 23 | + required: true |
| 24 | + type: string |
| 25 | + |
| 26 | +permissions: |
| 27 | + contents: read |
| 28 | + |
| 29 | +jobs: |
| 30 | + publish-emoji: |
| 31 | + name: Publish ${{ github.ref_name }} to Maven Central |
| 32 | + runs-on: ubuntu-latest |
| 33 | + # Only ship plain semver tags (emoji-vX.Y.Z) to Central; pre-release |
| 34 | + # suffixes ship nowhere from here. |
| 35 | + if: | |
| 36 | + github.event_name == 'workflow_dispatch' || |
| 37 | + (!contains(github.ref, '-rc') && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-snapshot')) |
| 38 | + env: |
| 39 | + JAVA_TOOL_OPTIONS: -Djava.awt.headless=true |
| 40 | + |
| 41 | + steps: |
| 42 | + - name: Check out repository at tag |
| 43 | + uses: actions/checkout@v7 |
| 44 | + with: |
| 45 | + ref: ${{ github.event.inputs.tag || github.ref }} |
| 46 | + |
| 47 | + - name: Set up Temurin JDK 17 with Central credentials and GPG key |
| 48 | + uses: actions/setup-java@v5 |
| 49 | + with: |
| 50 | + distribution: temurin |
| 51 | + java-version: '17' |
| 52 | + cache: maven |
| 53 | + server-id: central |
| 54 | + server-username: CENTRAL_USERNAME |
| 55 | + server-password: CENTRAL_TOKEN |
| 56 | + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} |
| 57 | + gpg-passphrase: MAVEN_GPG_PASSPHRASE |
| 58 | + |
| 59 | + - name: Publish emoji to Maven Central |
| 60 | + # Activates the emoji module's release profile (sources + javadoc + |
| 61 | + # gpg sign + central-publishing) and flips gpg.skip=false. Blocks |
| 62 | + # until Sonatype's validator confirms validation. |
| 63 | + run: ./mvnw -B -ntp -f emoji/pom.xml -P release -Dgpg.skip=false deploy |
| 64 | + env: |
| 65 | + CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} |
| 66 | + CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }} |
| 67 | + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |
0 commit comments