Skip to content

Commit 20c5434

Browse files
committed
Switch to GitHub actions for sonatype OSS deploy
1 parent b050586 commit 20c5434

9 files changed

Lines changed: 139 additions & 30 deletions

File tree

.github/workflows/maven-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Default build validation "clean verify" for non-experimental branches
2-
# "master" branch is excluded, it's updated only on an gitflow release
1+
# Build validation
32

43
name: Build
54

65
on:
76
push:
87
branches-ignore:
9-
- 'master'
10-
- 'experimental/**'
8+
- master
9+
- experimental/**
1110
pull_request:
1211
branches-ignore:
13-
- 'master'
14-
- 'experimental/**'
12+
- master
13+
- experimental/**
14+
workflow_dispatch:
1515

1616
jobs:
1717
build:

.github/workflows/maven-deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Deploy snapshots to Sonatpe OSS repository and deploy site to GitHub Pages
2+
3+
name: Deploy
4+
5+
on:
6+
push:
7+
branches:
8+
- develop
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
# Check out Git repository
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
# Configure GIT
22+
- name: Configure GIT
23+
run: |
24+
git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}"
25+
git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}"
26+
27+
# Set up environment with Java and Maven
28+
- name: Setup JDK
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
# Set up dependency cache
34+
- name: Cache local Maven repository
35+
uses: actions/cache@v2
36+
with:
37+
path: ~/.m2/repository
38+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
39+
restore-keys: |
40+
${{ runner.os }}-maven-
41+
42+
# Build, deploy to ossrh, generate and stage site
43+
- name: Build, verify, deploy, generate site
44+
env:
45+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
46+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
47+
run: mvn -s ./.maven-settings.xml -Pcontinuous-integration -B -U clean deploy site
48+
49+
# Deploy site to Github Pages
50+
- name: Stage and deploy site
51+
run: >
52+
mvn -s ./.maven-settings.xml -Pcontinuous-integration -B site:stage scm-publish:publish-scm
53+
-Dscmpublish.checkinComment="Maven site: ${{ github.repository }}"
54+
-Dusername=${{ secrets.GH_SITE_DEPLOY_USERNAME }}
55+
-Dpassword=${{ secrets.GH_SITE_DEPLOY_PAT }}

.maven-settings.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,12 @@
147147
<activeProfile>default</activeProfile>
148148
</activeProfiles>
149149

150+
<servers>
151+
<server>
152+
<id>ossrh</id>
153+
<username>${env.SONATYPE_USERNAME}</username>
154+
<password>${env.SONATYPE_PASSWORD}</password>
155+
</server>
156+
</servers>
157+
150158
</settings>

conga-aem-plugin/pom.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</scm>
4646

4747
<properties>
48-
<site.url.module.prefix>conga/plugins/aem/conga-aem-plugin</site.url.module.prefix>
48+
<site.url.module.prefix>conga-aem-plugin</site.url.module.prefix>
4949
</properties>
5050

5151
<dependencies>
@@ -221,12 +221,25 @@
221221
</plugin>
222222

223223
</plugins>
224+
<pluginManagement>
225+
<plugins>
226+
227+
<plugin>
228+
<groupId>org.apache.maven.plugins</groupId>
229+
<artifactId>maven-site-plugin</artifactId>
230+
<configuration>
231+
<topSiteURL>${site.deploy.url}</topSiteURL>
232+
</configuration>
233+
</plugin>
234+
235+
</plugins>
236+
</pluginManagement>
224237
</build>
225238

226239
<distributionManagement>
227240
<site>
228241
<id>${site.deploy.id}</id>
229-
<url>${site.deploy.url}${site.url.module.prefix}</url>
242+
<url>${site.deploy.url}/${site.url.module.prefix}</url>
230243
</site>
231244
</distributionManagement>
232245

example/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
<groupId>org.apache.maven.plugins</groupId>
9595
<artifactId>maven-site-plugin</artifactId>
9696
<configuration>
97+
<skip>true</skip>
9798
<skipDeploy>true</skipDeploy>
9899
</configuration>
99100
</plugin>

pom.xml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@
5959
<build>
6060
<plugins>
6161

62-
<!-- do not deploy this hierarchy pom into maven repository -->
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-deploy-plugin</artifactId>
66-
<configuration>
67-
<skip>true</skip>
68-
</configuration>
69-
</plugin>
70-
7162
<!-- Set property ${releasedVersion.version} for current project - to be used in maven site -->
7263
<plugin>
7364
<groupId>org.codehaus.mojo</groupId>
@@ -82,13 +73,39 @@
8273
</executions>
8374
</plugin>
8475

76+
<!-- do not deploy this hierarchy pom into maven repository -->
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-deploy-plugin</artifactId>
80+
<configuration>
81+
<skip>true</skip>
82+
</configuration>
83+
</plugin>
84+
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-site-plugin</artifactId>
88+
<configuration>
89+
<topSiteURL>${site.deploy.url}</topSiteURL>
90+
</configuration>
91+
</plugin>
92+
93+
<plugin>
94+
<groupId>org.apache.maven.plugins</groupId>
95+
<artifactId>maven-scm-publish-plugin</artifactId>
96+
<configuration>
97+
<subDirectory>${site.url.module.prefix}</subDirectory>
98+
<skipDeletedFiles>true</skipDeletedFiles>
99+
</configuration>
100+
</plugin>
101+
85102
</plugins>
86103
</build>
87104

88105
<distributionManagement>
89106
<site>
90107
<id>${site.deploy.id}</id>
91-
<url>${site.deploy.url}${site.url.module.prefix}</url>
108+
<url>${site.deploy.url}</url>
92109
</site>
93110
</distributionManagement>
94111

src/site/markdown/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Additionally the CONGA AEM Maven plugin is provided which allows to deploy a bun
4242
[usage]: usage.html
4343
[extensions]: extensions.html
4444
[apidocs]: conga-aem-plugin/apidocs/
45-
[plugindocs]: conga-aem-maven-plugin/plugin-info.html
45+
[plugindocs]: tooling/conga-aem-maven-plugin/plugin-info.html
4646
[changelog]: changes-report.html
4747
[aem]: http://www.adobe.com/solutions/web-experience-management.html
4848
[conga]: https://devops.wcm.io/conga/

tooling/conga-aem-crypto-cli/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,17 @@
198198
</executions>
199199
</plugin>
200200

201+
<!-- do not generate site for this project -->
202+
<plugin>
203+
<groupId>org.apache.maven.plugins</groupId>
204+
<artifactId>maven-site-plugin</artifactId>
205+
<inherited>false</inherited>
206+
<configuration>
207+
<skip>true</skip>
208+
<skipDeploy>true</skipDeploy>
209+
</configuration>
210+
</plugin>
211+
201212
</plugins>
202213
</build>
203214

tooling/conga-aem-maven-plugin/pom.xml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
<properties>
4141
<maven.version>3.0.5</maven.version>
42-
<site.url.module.prefix>conga/plugins/aem/conga-aem-maven-plugin</site.url.module.prefix>
42+
<site.url.module.prefix>tooling/conga-aem-maven-plugin</site.url.module.prefix>
4343
</properties>
4444

4545
<prerequisites>
@@ -163,16 +163,20 @@
163163
</executions>
164164
</plugin>
165165

166-
<!-- deploy site because because of generated plugin docs -->
167-
<plugin>
168-
<groupId>org.apache.maven.plugins</groupId>
169-
<artifactId>maven-site-plugin</artifactId>
170-
<configuration>
171-
<skipDeploy>false</skipDeploy>
172-
</configuration>
173-
</plugin>
174-
175166
</plugins>
167+
<pluginManagement>
168+
<plugins>
169+
170+
<plugin>
171+
<groupId>org.apache.maven.plugins</groupId>
172+
<artifactId>maven-site-plugin</artifactId>
173+
<configuration>
174+
<topSiteURL>${site.deploy.url}</topSiteURL>
175+
</configuration>
176+
</plugin>
177+
178+
</plugins>
179+
</pluginManagement>
176180
</build>
177181

178182
<reporting>
@@ -251,7 +255,7 @@
251255
<distributionManagement>
252256
<site>
253257
<id>${site.deploy.id}</id>
254-
<url>${site.deploy.url}${site.url.module.prefix}</url>
258+
<url>${site.deploy.url}/${site.url.module.prefix}</url>
255259
</site>
256260
</distributionManagement>
257261

0 commit comments

Comments
 (0)