Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/internal-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish package to the JFROG Artifactory
on:
push:
tags: '*.*.*'
paths-ignore:
- "pom.xml"
- "*.md"
branches:
- release/*

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Jfrog artifactory
uses: actions/setup-java@v1
with:
java-version: '1.8'
distribution: 'adopt'
server-id: central
server-username: JFROG_USERNAME
server-password: JFROG_PASSWORD
gpg-private-key: ${{ secrets.JFROG_GPG_KEY }} # Value of the GPG private key to import
gpg-passphrase: JFROG_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Get Previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: 1.0.0

- name: Bump Version
run: |
chmod +x ./scripts/bump_version.sh
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")"

- name: Commit changes
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
git add pom.xml
git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev.$(git rev-parse --short $GITHUB_SHA)"
git push origin -f

- name: Create env
id: create-env
run: |
touch .env
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env

- name: Create credentials json
id: create-json
uses: jsdaniell/create-json@1.1.2
with:
name: "credentials.json"
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}

- name: Publish package to Jfrog Artifactory
run: mvn clean deploy -P jfrog
env:
JFROG_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
JFROG_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
JFROG_GPG_PASSPHRASE: ${{ secrets.JFROG_GPG_PASSPHRASE }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}

- name: Publish package to Maven Central
run: mvn --batch-mode deploy
run: mvn --batch-mode deploy -P maven-central
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down
69 changes: 45 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.skyflow</groupId>
<artifactId>skyflow-java</artifactId>
<version>1.15.0</version>
<version>1.15.0-v2dev2.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down Expand Up @@ -44,17 +44,6 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
</properties>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>

<dependencies>
<!-- newly added v2 dependencies -->
<dependency>
Expand Down Expand Up @@ -132,17 +121,17 @@

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.sonatype.plugins</groupId>-->
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!-- <version>1.6.7</version>-->
<!-- <extensions>true</extensions>-->
<!-- <configuration>-->
<!-- <serverId>ossrh</serverId>-->
<!-- <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>-->
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -189,6 +178,7 @@
<configuration>
<excludes>
<exclude>**/example/*</exclude>
<exclude>**/generated/rest/**</exclude>
</excludes>
</configuration>
<executions>
Expand Down Expand Up @@ -252,4 +242,35 @@
</repository>
</repositories>

</project>
<profiles>
<profile>
<id>maven-central</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>jfrog</id>
<distributionManagement>
<repository>
<id>central</id>
<name>prekarilabs.jfrog.io-releases</name>
<url>https://prekarilabs.jfrog.io/artifactory/skyflow-java</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>prekarilabs.jfrog.io-snapshots</name>
<url>https://prekarilabs.jfrog.io/artifactory/skyflow-java</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>

</project>
40 changes: 40 additions & 0 deletions scripts/bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Input Arguments
Version=$1
CommitHash=$2
PomFile="../pom.xml"

if [ -z "$Version" ]; then
echo "Error: Version argument is required."
exit 1
fi

# Update only the main project's <version>
if [ -z "$CommitHash" ]; then
echo "Bumping main project version to $Version"

awk -v version="$Version" '
BEGIN { updated = 0 }
/<version>/ && updated == 0 {
sub(/<version>.*<\/version>/, "<version>" version "</version>")
updated = 1
}
{ print }
' "$PomFile" > tempfile && cat tempfile > "$PomFile" && rm -f tempfile

echo "--------------------------"
echo "Done. Main project version now at $Version"
else
echo "Bumping main project version to $Version-dev-$CommitHash"

awk -v version="$Version-dev.$CommitHash" '
BEGIN { updated = 0 }
/<version>/ && updated == 0 {
sub(/<version>.*<\/version>/, "<version>" version "</version>")
updated = 1
}
{ print }
' "$PomFile" > tempfile && cat tempfile > "$PomFile" && rm -f tempfile

echo "--------------------------"
echo "Done. Main project version now at $Version-dev.$CommitHash"
fi
Loading