Skip to content

Commit 1deebcc

Browse files
SK-2258 add release steps
1 parent 29a36af commit 1deebcc

7 files changed

Lines changed: 48 additions & 81 deletions

File tree

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
name: Publish package to the JFROG Artifactory
1+
name: Publish v3 module to the JFROG Artifactory
22
on:
33
push:
44
tags-ignore:
55
- '*.*'
66
paths-ignore:
77
- "*.md"
88
branches:
9-
- release/*
9+
- v3-release/*
1010

1111
jobs:
12-
build-and-deploy:
12+
build-and-deploy-v3:
1313
uses: ./.github/workflows/shared-build-and-deploy.yml
1414
with:
1515
ref: ${{ github.ref_name }}
1616
server-id: central
1717
profile: jfrog
1818
tag: 'internal'
19+
module: 'v3'
1920
secrets:
2021
server-username: ${{ secrets.ARTIFACTORY_USERNAME }}
2122
server-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
2223
gpg-key: ${{ secrets.JFROG_GPG_KEY }}
2324
gpg-passphrase: ${{ secrets.JFROG_GPG_PASSPHRASE }}
2425
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
2526
test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
26-
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
27+
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env

.github/workflows/shared-build-and-deploy.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ on:
2121
description: 'Release Tag'
2222
required: true
2323
type: string
24+
25+
module:
26+
description: 'Module to build and publish'
27+
required: false
28+
type: string
29+
default: ''
30+
2431
secrets:
2532
server-username:
2633
required: true
@@ -99,7 +106,7 @@ jobs:
99106
git checkout ${{ env.branch_name }}
100107
fi
101108
102-
git add pom.xml
109+
git add v3/pom.xml
103110
if [[ "${{ inputs.tag }}" == "internal" ]]; then
104111
git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev-$(git rev-parse --short $GITHUB_SHA)"
105112
git push origin ${{ github.ref_name }} -f
@@ -125,9 +132,14 @@ jobs:
125132
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
126133

127134
- name: Publish package
128-
run: mvn --batch-mode deploy -P ${{ inputs.profile }}
135+
run: |
136+
if [ -n "${{ inputs.module }}" ]; then
137+
mvn --batch-mode -pl v3 -am deploy -P jfrog
138+
else
139+
mvn --batch-mode deploy -P ${{ inputs.profile }}
140+
fi
129141
130142
env:
131143
SERVER_USERNAME: ${{ secrets.server-username }}
132144
SERVER_PASSWORD: ${{ secrets.server-password }}
133-
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
145+
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}

common/pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>com.skyflow</groupId>
8-
<artifactId>skyflow-java</artifactId>
8+
<artifactId>skyflow</artifactId>
99
<version>1.0.0</version>
10+
<relativePath>../pom.xml</relativePath>
1011
</parent>
1112

1213
<artifactId>common</artifactId>
1314
<version>1.0.0</version>
1415

16+
1517
<properties>
1618
<maven.compiler.source>8</maven.compiler.source>
1719
<maven.compiler.target>8</maven.compiler.target>

pom.xml

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>com.skyflow</groupId>
8-
<artifactId>skyflow-java</artifactId>
8+
<artifactId>skyflow</artifactId>
99
<version>1.0.0</version>
1010
<packaging>pom</packaging>
1111

@@ -37,6 +37,7 @@
3737
</scm>
3838

3939
<properties>
40+
<maven.deploy.skip>true</maven.deploy.skip>
4041
<maven.compiler.source>8</maven.compiler.source>
4142
<maven.compiler.target>8</maven.compiler.target>
4243
<okhttp-version>4.12.0</okhttp-version>
@@ -256,36 +257,7 @@
256257
<url>https://repo.maven.apache.org/maven2/</url>
257258
</repository>
258259
</repositories>
259-
260260
<profiles>
261-
<profile>
262-
<id>maven-central</id>
263-
<distributionManagement>
264-
<repository>
265-
<id>central</id>
266-
<url>https://central.sonatype.com/api/v1/publisher/upload</url>
267-
</repository>
268-
<snapshotRepository>
269-
<id>central-snapshots</id>
270-
<url>https://central.sonatype.com/api/v1/publisher/upload</url>
271-
</snapshotRepository>
272-
</distributionManagement>
273-
<build>
274-
<plugins>
275-
<plugin>
276-
<groupId>org.sonatype.central</groupId>
277-
<artifactId>central-publishing-maven-plugin</artifactId>
278-
<version>0.4.0</version>
279-
<extensions>true</extensions>
280-
<configuration>
281-
<publishingServerId>central</publishingServerId>
282-
<tokenAuth>true</tokenAuth>
283-
<autoPublish>true</autoPublish>
284-
</configuration>
285-
</plugin>
286-
</plugins>
287-
</build>
288-
</profile>
289261
<profile>
290262
<id>jfrog</id>
291263
<distributionManagement>
@@ -302,4 +274,4 @@
302274
</distributionManagement>
303275
</profile>
304276
</profiles>
305-
</project>
277+
</project>

scripts/bump_version.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Input Arguments
22
Version=$1
33
CommitHash=$2
4-
PomFile="$GITHUB_WORKSPACE/pom.xml"
4+
PomFile="$GITHUB_WORKSPACE/v3/pom.xml"
55

66
if [ -z "$Version" ]; then
77
echo "Error: Version argument is required."
@@ -26,15 +26,16 @@ if [ -z "$CommitHash" ]; then
2626
else
2727
echo "Bumping main project version to $Version-dev-$CommitHash"
2828

29-
awk -v version="$Version-dev.$CommitHash" '
30-
BEGIN { updated = 0 }
31-
/<version>/ && updated == 0 {
32-
sub(/<version>.*<\/version>/, "<version>" version "</version>")
33-
updated = 1
34-
}
35-
{ print }
36-
' "$PomFile" > tempfile && cat tempfile > "$PomFile" && rm -f tempfile
29+
awk -v version="$Version${CommitHash:+-dev.$CommitHash}" '
30+
BEGIN { updated = 0 }
31+
/<parent>/,/<\/parent>/ { print; next }
32+
/<version>/ && updated == 0 {
33+
sub(/<version>.*<\/version>/, "<version>" version "</version>")
34+
updated = 1
35+
}
36+
{ print }
37+
' "$PomFile" > tempfile && cat tempfile > "$PomFile" && rm -f tempfile
3738

38-
echo "--------------------------"
39-
echo "Done. Main project version now at $Version-dev.$CommitHash"
40-
fi
39+
echo "--------------------------"
40+
echo "Done. v3 module version now at $Version${CommitHash:+-dev.$CommitHash}"
41+
fi

v2/pom.xml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>com.skyflow</groupId>
8-
<artifactId>skyflow-java</artifactId>
8+
<artifactId>skyflow</artifactId>
99
<version>1.0.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

1313
<artifactId>skyflow-java</artifactId>
14-
<version>2.0.0-beta.2</version>
15-
<packaging>jar</packaging>
14+
<version>2.0.0-beta.3</version>
15+
<groupId>com.skyflow</groupId>
1616

1717
<properties>
1818
<maven.compiler.source>8</maven.compiler.source>
@@ -26,30 +26,6 @@
2626
<artifactId>common</artifactId>
2727
<version>1.0.0</version>
2828
</dependency>
29-
</dependencies>
3029

31-
<build>
32-
<plugins>
33-
<plugin>
34-
<groupId>org.apache.maven.plugins</groupId>
35-
<artifactId>maven-shade-plugin</artifactId>
36-
<version>3.6.0</version>
37-
<executions>
38-
<execution>
39-
<phase>package</phase>
40-
<goals>
41-
<goal>shade</goal>
42-
</goals>
43-
<configuration>
44-
<artifactSet>
45-
<includes>
46-
<include>com.skyflow:common</include>
47-
</includes>
48-
</artifactSet>
49-
</configuration>
50-
</execution>
51-
</executions>
52-
</plugin>
53-
</plugins>
54-
</build>
30+
</dependencies>
5531
</project>

v3/pom.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>com.skyflow</groupId>
8-
<artifactId>skyflow-java</artifactId>
8+
<artifactId>skyflow</artifactId>
99
<version>1.0.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

1313
<artifactId>skyflow-java</artifactId>
14-
<version>3.0.0-beta.0</version>
14+
<version>2.0.0-beta.2-dev.7db56c6</version>
1515
<packaging>jar</packaging>
1616

1717
<properties>
1818
<maven.compiler.source>8</maven.compiler.source>
1919
<maven.compiler.target>8</maven.compiler.target>
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21+
<maven.deploy.skip>false</maven.deploy.skip>
2122
</properties>
2223

24+
25+
2326
<dependencies>
2427
<dependency>
2528
<groupId>com.skyflow</groupId>

0 commit comments

Comments
 (0)