Skip to content

Commit

Permalink
Deploy to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
segabriel committed Jan 12, 2021
1 parent 6bd02fa commit 08f8437
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/pre-release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,37 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy pre-release version to the Maven Central Repository
run: |
pre_release_version=${{ github.event.release.tag_name }}
echo Pre-release version $pre_release_version
mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false
mvn versions:commit
mvn clean deploy -Pdeploy2Maven -DskipTests -B -V
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Deploy pre-release version
- name: Deploy pre-release version to GitHub Packages
run: |
pre_release_version=${{ github.event.release.tag_name }}
echo Pre-release version $pre_release_version
mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false
mvn versions:commit
mvn clean deploy -B -V
mvn clean deploy -Pdeploy2Github -DskipTests -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Rollback pre-release (remove tag)
Expand Down
28 changes: 20 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
</license>
</licenses>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/scalecube/scalecube-parent</url>
</repository>
</distributionManagement>

<scm>
<url>https://scalecube.io</url>
<connection>scm:git:https://github.com/scalecube/scalecube-parent.git</connection>
Expand Down Expand Up @@ -396,6 +388,26 @@
<dockerfile.skip>false</dockerfile.skip>
</properties>
</profile>
<profile>
<id>deploy2Github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/scalecube/scalecube-parent</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>deploy2Maven</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>

</project>

0 comments on commit 08f8437

Please sign in to comment.