Skip to content

Commit f21e015

Browse files
authored
feat: cd
Create CD workflow to deploy new versions of the library in maven central every time a release is created
2 parents 1e93f74 + fb088be commit f21e015

60 files changed

Lines changed: 43 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Maven Central Repository
11+
uses: actions/setup-java@v4
12+
with:
13+
java-version: "17"
14+
distribution: "temurin"
15+
server-id: ossrh
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
- name: Install gpg secret key
19+
run: |
20+
# Install gpg secret key
21+
echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
22+
# Verify that the key ID is shown in the logs
23+
gpg --list-secret-keys --keyid-format LONG | grep "${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}"
24+
- name: Publish to Central Repository
25+
env:
26+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
27+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
28+
run: |
29+
mvn \
30+
--no-transfer-progress \
31+
--batch-mode \
32+
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
33+
clean deploy

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>io.github.isa-group</groupId>
99
<artifactId>Pricing4Java</artifactId>
10-
<version>4.0.1</version>
10+
<version>5.0.0</version>
1111

1212
<name>${project.groupId}:${project.artifactId}</name>
1313
<description>A pricing driven feature toggling library for java</description>
@@ -197,6 +197,12 @@
197197
<goals>
198198
<goal>sign</goal>
199199
</goals>
200+
<configuration>
201+
<gpgArguments>
202+
<arg>--pinentry-mode</arg>
203+
<arg>loopback</arg>
204+
</gpgArguments>
205+
</configuration>
200206
</execution>
201207
</executions>
202208
</plugin>

src/test/java/io/github/isagroup/updaters/UpdatersTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void givenV20PriceShouldHoldMonthlyPriceV11() {
5454

5555
Yaml yaml = new Yaml();
5656

57-
try (FileInputStream fileInputStream = new FileInputStream("src/main/resources/updating/v11-v20/price-holds-monthlyPrice.yml")) {
57+
try (FileInputStream fileInputStream = new FileInputStream("src/test/resources/updating/v11-v20/price-holds-monthlyPrice.yml")) {
5858
Map<String,Object> configFile = yaml.load(fileInputStream);
5959
YamlUpdater.update(configFile);
6060
Map<String,Object> plans = (Map<String, Object>) configFile.get("plans");
@@ -70,7 +70,7 @@ void givenV20PriceShouldHoldV11AnnualPriceWhenMonthlyPriceIsNull() {
7070

7171
Yaml yaml = new Yaml();
7272

73-
try (FileInputStream fileInputStream = new FileInputStream("src/main/resources/updating/v11-v20/price-holds-annualPrice.yml")) {
73+
try (FileInputStream fileInputStream = new FileInputStream("src/test/resources/updating/v11-v20/price-holds-annualPrice.yml")) {
7474
Map<String,Object> configFile = yaml.load(fileInputStream);
7575
YamlUpdater.update(configFile);
7676
Map<String,Object> plans = (Map<String, Object>) configFile.get("plans");
@@ -85,7 +85,7 @@ void givenV20PriceShouldHoldV11AnnualPriceWhenMonthlyPriceIsNull() {
8585
void givenInvalidTypeInMonthlyPriceShouldThrow() {
8686
Yaml yaml = new Yaml();
8787

88-
try (FileInputStream fileInputStream = new FileInputStream("src/main/resources/updating/v11-v20/monthlyPrice-is-boolean.yml")) {
88+
try (FileInputStream fileInputStream = new FileInputStream("src/test/resources/updating/v11-v20/monthlyPrice-is-boolean.yml")) {
8989
Map<String,Object> configFile = yaml.load(fileInputStream);
9090
YamlUpdater.update(configFile);
9191
fail();

src/main/resources/parsing/add-ons/negative/add-ons-usage-limits-extensions-not-a-map.yml renamed to src/test/resources/parsing/add-ons/negative/add-ons-usage-limits-extensions-not-a-map.yml

File renamed without changes.

src/main/resources/parsing/add-ons/negative/add-ons-usage-limits-not-a-map.yml renamed to src/test/resources/parsing/add-ons/negative/add-ons-usage-limits-not-a-map.yml

File renamed without changes.

src/main/resources/parsing/feature/negative/feature-is-key-value.yml renamed to src/test/resources/parsing/feature/negative/feature-is-key-value.yml

File renamed without changes.

src/main/resources/parsing/feature/negative/feature-null-as-key.yml renamed to src/test/resources/parsing/feature/negative/feature-null-as-key.yml

File renamed without changes.

src/main/resources/parsing/feature/negative/null-type.yml renamed to src/test/resources/parsing/feature/negative/null-type.yml

File renamed without changes.

src/main/resources/parsing/feature/negative/null-value-type.yml renamed to src/test/resources/parsing/feature/negative/null-value-type.yml

File renamed without changes.

src/main/resources/parsing/feature/negative/unsuported-value-type.yml renamed to src/test/resources/parsing/feature/negative/unsuported-value-type.yml

File renamed without changes.

0 commit comments

Comments
 (0)