Skip to content

Commit

Permalink
update maven-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Bonifacio committed Oct 5, 2023
1 parent 42e2a67 commit 8e624ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 45 deletions.
40 changes: 16 additions & 24 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
# 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: Maven Package

name: Publish package to the Maven Central Repository
on:
release:
types: [created]

jobs:
build:

publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file try-monad/pom.xml

- name: Publish to Apache Maven Central
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml --file try-monad/pom.xml
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn --file try-monad/pom.xml --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_ID }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
21 changes: 0 additions & 21 deletions settings.xml

This file was deleted.

0 comments on commit 8e624ca

Please sign in to comment.