-
Notifications
You must be signed in to change notification settings - Fork 4
Fix/sonatype deploy update #28
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| * @ExpediaGroup/eg-oss-poms-committers | ||
| * @ExpediaGroup/eg-oss-poms-committers @ExpediaGroup/apiary-committers | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Build and deploy Snapshot | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch: | ||
| description: "The branch to build a SNAPSHOT from." | ||
| required: true | ||
| default: "main" | ||
| jobs: | ||
| deploy: | ||
| name: Build SNAPSHOT to Sonatype | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.inputs.branch }} | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v2 | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '8' | ||
| java-package: jdk | ||
| server-id: central # Value of the distributionManagement/repository/id field of the pom.xml | ||
| server-username: SONATYPE_USERNAME # env variable for username in deploy | ||
| server-password: SONATYPE_PASSWORD # env variable for token in deploy | ||
| # only signed artifacts will be released to maven central. this sets up things for the maven-gpg-plugin | ||
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
| gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase | ||
| # this creates a settings.xml with the following server | ||
| settings-path: ${{ github.workspace }} | ||
|
|
||
| - name: Run Maven Targets | ||
| run: mvn deploy --settings $GITHUB_WORKSPACE/settings.xml --batch-mode --show-version --no-transfer-progress --activate-profiles sonatype-oss-release-github-actions | ||
| env: | ||
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
| GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Release to Maven Central | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| branch: | ||
| description: "The branch to release from." | ||
| required: true | ||
| default: "main" | ||
| jobs: | ||
| release: | ||
| name: Release to Maven Central | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.inputs.branch }} | ||
| # We need a personal access token to be able to push to a protected branch | ||
| token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v2 | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '8' | ||
| java-package: jdk | ||
| server-id: central # Value of the distributionManagement/repository/id field of the pom.xml | ||
| server-username: SONATYPE_USERNAME # env variable for username in deploy | ||
| server-password: SONATYPE_PASSWORD # env variable for token in deploy | ||
| # only signed artifacts will be released to maven central. This sets up things for the maven-gpg-plugin | ||
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
| gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase | ||
| # this creates a settings.xml with the following server | ||
| settings-path: ${{ github.workspace }} | ||
|
|
||
| - name: Configure Git User | ||
| run: | | ||
| git config user.email "oss@expediagroup.com" | ||
| git config user.name "eg-oss-ci" | ||
| - name: Run Maven Targets | ||
| run: mvn release:prepare release:perform --settings $GITHUB_WORKSPACE/settings.xml --activate-profiles sonatype-oss-release-github-actions --batch-mode --show-version --no-transfer-progress | ||
| env: | ||
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
| GPG_PASSPHRASE: ${{secrets.GPG_PRIVATE_KEY_PASSPHRASE}} |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
|
|
||
| <groupId>com.expediagroup</groupId> | ||
| <artifactId>eg-oss-parent</artifactId> | ||
| <version>2.4.2-SNAPSHOT</version> | ||
| <version>3.0.0-SNAPSHOT</version> | ||
| <description>Parent POM for Expedia Group open source projects</description> | ||
| <packaging>pom</packaging> | ||
| <url>https://github.com/ExpediaGroup/eg-oss-parent</url> | ||
|
|
@@ -88,17 +88,6 @@ | |
| <spotless.config.execution.skip>false</spotless.config.execution.skip> | ||
| </properties> | ||
|
|
||
| <distributionManagement> | ||
| <snapshotRepository> | ||
| <id>sonatype-nexus-snapshots</id> | ||
| <url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
| </snapshotRepository> | ||
| <repository> | ||
| <id>sonatype-nexus-staging</id> | ||
| <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> | ||
| </repository> | ||
| </distributionManagement> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
|
|
@@ -318,17 +307,6 @@ | |
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.sonatype.plugins</groupId> | ||
| <artifactId>nexus-staging-maven-plugin</artifactId> | ||
| <version>${nexus.staging.maven.plugin.version}</version> | ||
| <extensions>true</extensions> | ||
| <configuration> | ||
| <serverId>sonatype-nexus-staging</serverId> | ||
| <nexusUrl>https://oss.sonatype.org/</nexusUrl> | ||
| <autoReleaseAfterClose>true</autoReleaseAfterClose> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
|
|
||
| <pluginManagement> | ||
|
|
@@ -472,50 +450,22 @@ | |
| </plugins> | ||
| </build> | ||
| </profile> | ||
| <!-- | ||
| The profile `sonatype-oss-release` is going to be deprecated in the future because we will use | ||
| `sonatype-oss-release-github-actions` instead, which allows to do releases in Github instead of Jenkins. | ||
| The `sonatype-oss-release-github-actions` profile doesn't work in Jenkins so we will leave it here for | ||
| backwards compatibility, but you should migrate to use that one whenever it is possible. | ||
| --> | ||
| <profile> | ||
| <id>sonatype-oss-release</id> | ||
| <id>sonatype-oss-release-github-actions</id> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why you changed the id name?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah okay there were 2 profiles and now we just have 1?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
| <build> | ||
| <plugins> | ||
| <!--See https://central.sonatype.org/publish/publish-portal-maven/#publishing --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-gpg-plugin</artifactId> | ||
| <version>${maven.gpg.plugin.version}</version> | ||
| <executions> | ||
| <execution> | ||
| <id>sign-artifacts</id> | ||
| <phase>verify</phase> | ||
| <goals> | ||
| <goal>sign</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-source-plugin</artifactId> | ||
| <version>${maven.source.plugin.version}</version> | ||
| <executions> | ||
| <execution> | ||
| <id>attach-sources</id> | ||
| <goals> | ||
| <goal>jar-no-fork</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| <groupId>org.sonatype.central</groupId> | ||
| <artifactId>central-publishing-maven-plugin</artifactId> | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the new plugin |
||
| <version>0.8.0</version> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. variable for version?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah maybe in a next pr. |
||
| <extensions>true</extensions> | ||
| <configuration> | ||
| <publishingServerId>central</publishingServerId> | ||
| <autoPublish>true</autoPublish> | ||
| <waitUntil>published</waitUntil> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
| <profile> | ||
| <id>sonatype-oss-release-github-actions</id> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-gpg-plugin</artifactId> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old sonatype deploy plugin it clashes with new way so it's removed.