Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix deploy to maven central #35

Merged
merged 3 commits into from
Sep 28, 2023
Merged

ci: fix deploy to maven central #35

merged 3 commits into from
Sep 28, 2023

Conversation

nicklasl
Copy link
Member

@nicklasl nicklasl commented Sep 28, 2023

Correct references

The maven plugin to deploy artefacts uses the repos defined in distributionManagement when uploading. These repos require username and passwords set as part of some place.

The actions/setup-java@v3 will setup a file /home/runner/.m2/settings.xml for us with the contents:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>ossrh</id>
      <username>${env.MAVEN_USERNAME}</username>
      <password>${env.MAVEN_PASSWORD}</password>
    </server>
    <server>
      <id>gpg.passphrase</id>
      <passphrase>${env.GPG_PASS}</passphrase>
    </server>
  </servers>
</settings>

The xml file references the environment variables MAVEN_USERNAME, MAVEN_PASSWORD and GPG_PASS which are set as environment variables in the Deploy with Maven step with the values from Github secrets.

@nicklasl nicklasl marked this pull request as ready for review September 28, 2023 09:35
@nicklasl nicklasl changed the title ci: add back m2-settings.xml ci: fix release deploy to maven central Sep 28, 2023
@nicklasl nicklasl changed the title ci: fix release deploy to maven central ci: fix deploy to maven central Sep 28, 2023
@nicklasl nicklasl merged commit ecffd82 into main Sep 28, 2023
4 checks passed
@nicklasl nicklasl deleted the fix-release-upload branch September 28, 2023 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants