diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0e370cdd..43e9494e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Maven Build +name: CI Build on: push: @@ -31,3 +31,9 @@ jobs: ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} run: ./mvnw -B clean deploy -Pci,artifactory + + - name: Deploy documentation + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + run: ./mvnw -B clean deploy -Pdocumentation diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 00000000..8f7864e5 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,28 @@ +name: Publish Documentation + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + build: + name: Publish documentation + runs-on: ubuntu-latest + + steps: + + - name: Check out sources + uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 17 + cache: 'maven' + + - name: Deploy documentation + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + run: ./mvnw -B clean deploy -Pdocumentation diff --git a/.github/workflows/milestone.yaml b/.github/workflows/milestone.yaml new file mode 100644 index 00000000..19de1615 --- /dev/null +++ b/.github/workflows/milestone.yaml @@ -0,0 +1,40 @@ +name: Release Milestones + +on: + push: + branches: [ release/milestone ] + +jobs: + build: + name: Release project + runs-on: ubuntu-latest + + steps: + + - name: Check out sources + uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 17 + cache: 'maven' + + - name: Build with Maven + run: ./mvnw -B + + - name: Deploy to Artifactory + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + run: ./mvnw -B clean deploy -Pci,artifactory + + - name: Setup Graphviz + uses: ts-graphviz/setup-graphviz@v1 + + - name: Deploy documentation + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + run: ./mvnw -B clean deploy -Pdocumentation diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..23342efd --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,41 @@ +name: Release to Maven Central + +on: + push: + branches: [ release/release ] + +jobs: + build: + name: Release project + runs-on: ubuntu-latest + + steps: + + - name: Check out sources + uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: 17 + cache: 'maven' + + - name: Install GPG key + run: | + echo "${{ secrets.GPG_PRIVATE_KEY }}" > gpg.asc + echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --passphrase-fd 0 --import gpg.asc + + - name: Release to Sonatype OSSRH + env: + SONATYPE_USER: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }} + run: | + ./mvnw -B clean install -DskipTests + ./mvnw -B clean deploy -Psonatype -s settings.xml -Dgpg.passphrase='${{ secrets.GPG_PASSPHRASE }}' + + - name: Deploy documentation + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + run: ./mvnw -B clean deploy -Pdocumentation diff --git a/pom.xml b/pom.xml index 760dfdaa..d147f046 100644 --- a/pom.xml +++ b/pom.xml @@ -194,6 +194,7 @@ limitations under the License. org.apache.maven.plugins maven-gpg-plugin + 3.0.1 sign-artifacts @@ -214,6 +215,51 @@ limitations under the License. + + documentation + + true + + + + + org.jfrog.buildinfo + artifactory-maven-plugin + 3.4.0 + false + + + deploy-docs-to-artifactory + + publish + + + + https://repo.spring.io + *-docs.zip + ${env.ARTIFACTORY_USERNAME} + ${env.ARTIFACTORY_PASSWORD} + temp-private-local + temp-private-local + + + Documentation build for Spring Modulith ${project.version} + 1 + + + spring-modulith-docs + spring-modulith-docs + false + docs + + + + + + + + + diff --git a/settings.xml b/settings.xml new file mode 100644 index 00000000..fc63e6b2 --- /dev/null +++ b/settings.xml @@ -0,0 +1,12 @@ + + + + + sonatype-new + ${env.SONATYPE_USER} + ${env.SONATYPE_PASSWORD} + + +