Skip to content

Commit

Permalink
Publish Athena to Maven Central
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Jan 12, 2024
1 parent e9ab19d commit 92bf410
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 12 deletions.
55 changes: 46 additions & 9 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ jobs:
- uses: actionshub/markdownlint@main
with:
filesToIgnoreRegex: "docs/node_modules\\/.*"
# markdown-link-check:
# name: Markdown Link Check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: gaurav-nelson/github-action-markdown-link-check@v1
# with:
# use-verbose-mode: "yes"
markdown-link-check:
name: Markdown Link Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: "yes"

tests:
name: Unit & Integration Tests
needs: [yaml-lint, markdown-lint]
needs: [yaml-lint, markdown-lint, markdown-link-check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -131,3 +131,40 @@ jobs:
context: athena-examples/athena-example-books
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/athena-example-books:latest

maven-release:
name: Publish Athena to Maven Central
if: github.ref == 'refs/heads/master'
needs: tests
runs-on: ubuntu-latest
permissions:
contents: write # allow for pushing tag
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # https://github.com/actions/checkout/issues/338#issuecomment-732300720
- name: Set up JDK
uses: QubitPi/hashicorp-aws/hashicorp/webservice/auxiliary/github/actions/jdk-setup@master
- name: Tag for release
run: |
git config --global user.name '$USER'
git config --global user.email '$EMAIL'
.github/tag-for-release.bash
- name: Set release version
run: |
VERSION=$(git describe)
mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false
mvn versions:update-property -Dproperty=version.athena -DnewVersion=$VERSION -DgenerateBackupPoms=false
- name: Generate settings file
uses: whelk-io/maven-settings-xml-action@v20
with:
servers: >
[
{
"id": "ossrh",
"username": "${{ secrets.USERNAME }}",
"password": "${{ secrets.PASSWORD }}"
}
]
- name: Publish to Maven Central
run: mvn --batch-mode deploy
21 changes: 18 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@
</licenses>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>GitHub QubitPi Apache Maven Packages</name>
<url>https://maven.pkg.github.com/QubitPi/athena</url>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

Expand Down Expand Up @@ -588,6 +591,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 92bf410

Please sign in to comment.