Skip to content

Commit 779a45c

Browse files
authored
Merge pull request #13 from glib-briia/scala-release
Add deployment scripts
2 parents b082875 + 8c64926 commit 779a45c

File tree

5 files changed

+115
-46
lines changed

5 files changed

+115
-46
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@ install:
2626

2727
script:
2828
- mvn test -pl $MODULES_TO_RUN -B
29+
30+
deploy:
31+
provider: script
32+
script:
33+
- "./continuous-deployment/before-deploy.sh"
34+
- "./continuous-deployment/deploy.sh"
35+
on:
36+
branch: master
37+
38+
env:
39+
global:
40+
- secure: TO_BE_PROVIDED=
41+
- secure: TO_BE_PROVIDED=
42+
- secure: TO_BE_PROVIDED=
43+
- secure: TO_BE_PROVIDED=
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
3+
openssl aes-256-cbc -K $TO_BE_PROVIDED_key -iv $TO_BE_PROVIDED_iv -in continuous-deployment/codesigning.asc.enc -out continuous-deployment/codesigning.asc -d
4+
gpg -q --fast-import continuous-deployment/codesigning.asc
5+
fi

continuous-deployment/deploy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
3+
mvn deploy -P-examples -Psign-source-javadoc --settings continuous-deployment/travis-settings.xml -DskipTests=true
4+
else
5+
echo "Artifacts are only deployed on a build of the master branch"
6+
fi
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
4+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
5+
<servers>
6+
<server>
7+
<id>ossrh</id>
8+
<username>${env.CI_DEPLOY_USERNAME}</username>
9+
<password>${env.CI_DEPLOY_PASSWORD}</password>
10+
</server>
11+
</servers>
12+
<profiles>
13+
<profile>
14+
<id>ossrh</id>
15+
<activation>
16+
<activeByDefault>true</activeByDefault>
17+
</activation>
18+
<properties>
19+
<gpg.executable>gpg</gpg.executable>
20+
<gpg.useagent>false</gpg.useagent>
21+
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
22+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
23+
</properties>
24+
</profile>
25+
</profiles>
26+
</settings>

pom.xml

Lines changed: 63 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<version>4.1.0-SNAPSHOT</version>
66
<packaging>pom</packaging>
77
<name>Cucumber-JVM: Scala</name>
8+
<description>Cucumber for Scala</description>
89
<url>http://cucumber.io/</url>
910

1011
<parent>
@@ -17,6 +18,16 @@
1718
<maven>${minimum.maven.version}</maven>
1819
</prerequisites>
1920

21+
<developers>
22+
<developer>
23+
<id>glib-briia</id>
24+
<name>Glib Briia</name>
25+
<email>[email protected]</email>
26+
<organization>AssertThat</organization>
27+
<organizationUrl>https://www.assertthat.com</organizationUrl>
28+
</developer>
29+
</developers>
30+
2031
<properties>
2132
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2233
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -42,9 +53,9 @@
4253
</license>
4354
</licenses>
4455
<scm>
45-
<connection>scm:git:git://github.com/cucumber/cucumber-jvm.git</connection>
46-
<developerConnection>scm:git:[email protected]:cucumber/cucumber-jvm.git</developerConnection>
47-
<url>git://github.com/cucumber/cucumber-jvm.git</url>
56+
<connection>scm:git:git://github.com/cucumber/cucumber-jvm-scala.git</connection>
57+
<developerConnection>scm:git:[email protected]:cucumber/cucumber-jvm-scala.git</developerConnection>
58+
<url>git://github.com/cucumber/cucumber-jvm-scala.git</url>
4859
<tag>cucumber-jvm-2.0.0</tag>
4960
</scm>
5061

@@ -87,77 +98,67 @@
8798
</pluginRepository>
8899
</pluginRepositories>
89100

101+
<distributionManagement>
102+
<snapshotRepository>
103+
<id>ossrh</id>
104+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
105+
</snapshotRepository>
106+
<repository>
107+
<id>ossrh</id>
108+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
109+
</repository>
110+
</distributionManagement>
111+
90112
<modules>
91113
<module>scala</module>
92114
<module>examples</module>
93115
</modules>
94116

95117
<profiles>
96118
<profile>
97-
<id>release-sign-artifacts</id>
98-
<activation>
99-
<property>
100-
<name>performRelease</name>
101-
<value>true</value>
102-
</property>
103-
</activation>
119+
<id>sign-source-javadoc</id>
104120
<build>
105121
<plugins>
106122
<plugin>
107123
<groupId>org.apache.maven.plugins</groupId>
108-
<artifactId>maven-release-plugin</artifactId>
109-
<configuration>
110-
<tagNameFormat>v@{project.version}</tagNameFormat>
111-
</configuration>
124+
<artifactId>maven-source-plugin</artifactId>
125+
<executions>
126+
<execution>
127+
<id>attach-sources</id>
128+
<goals>
129+
<goal>jar-no-fork</goal>
130+
</goals>
131+
</execution>
132+
</executions>
133+
</plugin>
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-javadoc-plugin</artifactId>
137+
<executions>
138+
<execution>
139+
<id>attach-javadocs</id>
140+
<goals>
141+
<goal>jar</goal>
142+
</goals>
143+
</execution>
144+
</executions>
112145
</plugin>
113-
114146
<plugin>
115147
<groupId>org.apache.maven.plugins</groupId>
116148
<artifactId>maven-gpg-plugin</artifactId>
117-
<configuration>
118-
<useAgent>true</useAgent>
119-
</configuration>
120149
<executions>
121150
<execution>
122-
<id>sign-artifacts</id>
123151
<phase>verify</phase>
124152
<goals>
125153
<goal>sign</goal>
126154
</goals>
127155
</execution>
128156
</executions>
129157
</plugin>
130-
131158
</plugins>
132159
</build>
133160
</profile>
134161

135-
<profile>
136-
<id>travis-disable-deploy-by-default</id>
137-
<activation>
138-
<activeByDefault>false</activeByDefault>
139-
<property>
140-
<name>env.TRAVIS</name>
141-
<value>true</value>
142-
</property>
143-
</activation>
144-
<properties>
145-
<maven.deploy.skip>true</maven.deploy.skip>
146-
</properties>
147-
</profile>
148-
<profile>
149-
<id>travis-enable-deploy-if-not-pull-request</id>
150-
<activation>
151-
<activeByDefault>false</activeByDefault>
152-
<property>
153-
<name>env.TRAVIS_PULL_REQUEST</name>
154-
<value>false</value>
155-
</property>
156-
</activation>
157-
<properties>
158-
<maven.deploy.skip>false</maven.deploy.skip>
159-
</properties>
160-
</profile>
161162
<profile>
162163
<id>coveralls.io</id>
163164
<build>
@@ -382,6 +383,11 @@
382383
<artifactId>maven-enforcer-plugin</artifactId>
383384
<version>3.0.0-M1</version>
384385
</plugin>
386+
<plugin>
387+
<groupId>org.sonatype.plugins</groupId>
388+
<artifactId>nexus-staging-maven-plugin</artifactId>
389+
<version>1.6.7</version>
390+
</plugin>
385391
</plugins>
386392
</pluginManagement>
387393

@@ -424,6 +430,17 @@
424430
</execution>
425431
</executions>
426432
</plugin>
433+
<plugin>
434+
<groupId>org.sonatype.plugins</groupId>
435+
<artifactId>nexus-staging-maven-plugin</artifactId>
436+
<extensions>true</extensions>
437+
<configuration>
438+
<serverId>ossrh</serverId>
439+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
440+
<!--Manually review the non-snapshot artifacts for a while before automating the release -->
441+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
442+
</configuration>
443+
</plugin>
427444
</plugins>
428445

429446
<extensions>

0 commit comments

Comments
 (0)