Skip to content

Commit 761e6ec

Browse files
Merge pull request #5 from logdash-io/feat/maven-central-publishing-workflow
fix(ci): improve deployment process and bump version to 0.1.1
2 parents 4b21745 + 2100a33 commit 761e6ec

11 files changed

Lines changed: 19 additions & 81 deletions

File tree

.github/workflows/check-deployed-package.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ on:
66
workflows: ['CI/CD Pipeline']
77
types:
88
- completed
9-
branches:
10-
- main
119

1210
jobs:
1311
check-deployed-package:
1412
name: Check deployed package
1513
runs-on: ubuntu-latest
14+
if: >
15+
github.event.workflow_run.conclusion == 'success' &&
16+
github.event.workflow_run.event == 'push' &&
17+
startsWith(github.event.workflow_run.head_branch, 'refs/tags/v')
1618
permissions:
1719
contents: read
1820
packages: read

.github/workflows/ci.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,11 @@ jobs:
271271
272272
# Check if version already exists in GitHub Packages
273273
if gh api /orgs/logdash-io/packages/maven/io.logdash.logdash/versions --jq '.[] | .name' | grep -q "^$VERSION$"; then
274-
echo "::error::Version $VERSION already exists in GitHub Packages"
274+
echo "::warning::Version $VERSION already exists in GitHub Packages"
275275
echo "Either delete the existing version or bump the version in pom.xml"
276-
exit 1
276+
else
277+
echo "✅ Version $VERSION is available for release"
277278
fi
278-
279-
echo "✅ Version $VERSION is available for release"
280279
env:
281280
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
282281

@@ -358,12 +357,6 @@ jobs:
358357
CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
359358
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
360359

361-
- name: Wait for Central Processing
362-
run: |
363-
echo "⏳ Waiting for Maven Central processing..."
364-
sleep 60
365-
echo "✅ Maven Central processing should be complete"
366-
367360
- name: Notify Maven Central Success
368361
run: |
369362
echo "✅ Successfully deployed logdash:${{ steps.version.outputs.version }} to Maven Central"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ Add the dependency to your project:
3737
<dependency>
3838
<groupId>io.logdash</groupId>
3939
<artifactId>logdash</artifactId>
40-
<version>0.1.0</version>
40+
<version>0.1.1</version>
4141
</dependency>
4242
```
4343

4444
**Gradle:**
4545

4646
```gradle
4747
dependencies {
48-
implementation 'io.logdash:logdash:0.1.0'
48+
implementation 'io.logdash:logdash:0.1.1'
4949
}
5050
```
5151

5252
**Gradle (Kotlin DSL):**
5353

5454
```kotlin
5555
dependencies {
56-
implementation("io.logdash:logdash:0.1.0")
56+
implementation("io.logdash:logdash:0.1.1")
5757
}
5858
```
5959

@@ -72,7 +72,7 @@ Then use in your project:
7272
<dependency>
7373
<groupId>io.logdash</groupId>
7474
<artifactId>logdash</artifactId>
75-
<version>0.1.0</version>
75+
<version>0.1.1</version>
7676
</dependency>
7777
```
7878

check-deployed-package/Dockerfile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
FROM eclipse-temurin:17-jdk
22

3-
ARG GITHUB_TOKEN
4-
ARG GITHUB_ACTOR
5-
63
WORKDIR /app
74

85
# Install Maven
96
RUN apt-get update && apt-get install -y maven && rm -rf /var/lib/apt/lists/*
107

11-
# Set environment variables for Maven authentication
12-
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
13-
ENV GITHUB_ACTOR=${GITHUB_ACTOR}
14-
15-
# Copy Maven settings with GitHub authentication
16-
COPY check-deployed-package/settings.xml /root/.m2/settings.xml
17-
188
# Copy project files
199
COPY check-deployed-package/pom.xml .
2010
COPY check-deployed-package/Check.java src/main/java/com/logdash/check/Check.java
2111

2212
# Download dependencies and compile
23-
RUN mvn dependency:resolve compile -B --no-transfer-progress \
24-
-Dgithub.username=${GITHUB_ACTOR} \
25-
-Dgithub.password=${GITHUB_TOKEN}
13+
RUN mvn dependency:resolve compile -B --no-transfer-progress
2614

2715
# Add environment variable validation
2816
ENV LOGDASH_API_KEY=""

check-deployed-package/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dependency>
1616
<groupId>io.logdash</groupId>
1717
<artifactId>logdash</artifactId>
18-
<version>0.1.0</version>
18+
<version>0.1.1</version>
1919
</dependency>
2020
</dependencies>
2121

check-deployed-package/run.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ echo "Generated metrics seed: $METRICS_SEED"
1111

1212
echo "Building LogDash Java demo Docker image (using published package)..."
1313
docker build --no-cache \
14-
--build-arg GITHUB_TOKEN="${GITHUB_TOKEN}" \
15-
--build-arg GITHUB_ACTOR="${GITHUB_ACTOR}" \
1614
-t logdash-java-demo \
1715
-f check-deployed-package/Dockerfile .
1816

check-deployed-package/settings.xml

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/example-simple-java/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.example</groupId>
66
<artifactId>logdash-example</artifactId>
7-
<version>0.1.0</version>
7+
<version>0.1.1</version>
88
<packaging>jar</packaging>
99

1010
<name>Logdash Example Application</name>
@@ -16,7 +16,7 @@
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1717
<maven.compiler.release>21</maven.compiler.release>
1818

19-
<logdash-sdk.version>0.1.0</logdash-sdk.version>
19+
<logdash-sdk.version>0.1.1</logdash-sdk.version>
2020
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
2121
<maven-exec-plugin.version>3.1.1</maven-exec-plugin.version>
2222
</properties>

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.logdash</groupId>
66
<artifactId>logdash</artifactId>
7-
<version>0.1.0</version>
7+
<version>0.1.1</version>
88
<packaging>jar</packaging>
99

1010
<name>Logdash Java SDK</name>
@@ -551,7 +551,6 @@
551551
</goals>
552552
<phase>verify</phase>
553553
<configuration>
554-
<passphraseEnvVar>GPG_PASSPHRASE</passphraseEnvVar>
555554
<gpgArguments>
556555
<arg>--pinentry-mode</arg>
557556
<arg>loopback</arg>

src/main/java/io/logdash/sdk/transport/HttpTransport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public final class HttpTransport implements LogdashTransport, AutoCloseable {
3838
private static final String METRICS_ENDPOINT = "/metrics";
3939

4040
private static final String API_KEY_HEADER = "project-api-key";
41-
private static final String USER_AGENT = "logdash-java-sdk/0.1.0";
41+
private static final String USER_AGENT = "logdash-java-sdk/0.1.1";
4242
private static final String CONTENT_TYPE = "application/json";
4343

4444
private final LogdashConfig config;

0 commit comments

Comments
 (0)