Copy the license file #22
This file contains 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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | |
name: Publish to Nexus Sonatype OSS | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [created] | |
workflow_dispatch: | |
# To trigger the Env Test workflow manually, follow the instructions in | |
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | |
env: | |
SHARED_MVN_ARGS: '--show-version --no-transfer-progress' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repo files | |
uses: actions/[email protected] | |
with: | |
lfs: true | |
- name: Set up JDK | |
uses: actions/[email protected] | |
with: | |
java-version: '8' # The custom Taglets for javadoc (tools/build) are still Java 8. They need updating. | |
distribution: 'temurin' | |
server-id: icu4j-maven-repo # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: MAVEN_USERNAME # env variable for username in deploy | |
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
settings-path: ${{ github.workspace }} # location for the settings.xml file | |
- name: Dump info | |
run: | | |
echo '=== settings.xml ====================' | |
cat $GITHUB_WORKSPACE/settings.xml | |
echo '=======================' | |
ls -alir ~ | |
echo '=======================' | |
ls -ali ~/.gnupg | |
echo '=======================' | |
- name: Build and publish to Maven Central | |
run: | | |
mvn deploy --file icu4j \ | |
${SHARED_MVN_ARGS} \ | |
--batch-mode \ | |
--settings $GITHUB_WORKSPACE/settings.xml \ | |
--errors --fail-at-end -DdeployAtEnd=true \ | |
-DskipTests -DskipITs \ | |
-P with_sources,with_javadoc,with_signature | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |