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
69 changes: 11 additions & 58 deletions .github/workflows/internal-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,14 @@ on:
- release/*

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref_name }}
fetch-depth: 0

- 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 }}
build-and-deploy:
uses: ./.github/workflows/shared-build-and-deploy.yml
with:
ref: ${{ github.ref_name }}
is-internal: true
server-id: central
server-username: ${{ secrets.ARTIFACTORY_USERNAME }}
server-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
gpg-key: ${{ secrets.JFROG_GPG_KEY }}
gpg-passphrase: ${{ secrets.JFROG_GPG_PASSPHRASE }}
profile: jfrog
39 changes: 11 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,14 @@ on:
push:
tags: '*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: '1.8'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: create-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 Maven Central
run: mvn --batch-mode deploy -P maven-central
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
build-and-deploy:
uses: ./.github/workflows/shared-build-and-deploy.yml
with:
ref: ${{ github.ref_name }}
is-internal: false
server-id: ossrh
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_PASSWORD }}
gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
profile: maven-central
113 changes: 113 additions & 0 deletions .github/workflows/shared-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Shared Build and Deploy
on:
workflow_call:
inputs:
ref:
description: 'Git reference to use (e.g., main or branch name)'
required: true
type: string

is-internal:
description: 'Flag for internal release'
required: true
type: boolean

server-id:
description: 'Id of the repository'
required: true
type: string

server-username:
description: 'Username of the repository'
required: true
type: string

server-password:
description: 'Password of the repository'
required: true
type: string

gpg-key:
description: 'GPG key to access the repository'
required: true
type: string

gpg-passphrase:
description: 'GPG passphrase to access the repository'
required: true
type: string

profile:
description: 'Profile to pick from pom.xml'
required: true
type: string

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.ref }}
fetch-depth: 0

- name: Set up maven or jfrog repository
uses: actions/setup-java@v1
with:
java-version: '1.8'
distribution: 'adopt'
server-id: ${{ inputs.server-id }}
server-username: SERVER_USERNAME
server-password: SERVER_PASSWORD
gpg-private-key: ${{ inputs.gpg-key }} # Value of the GPG private key to import
gpg-passphrase: 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 ./ci-scripts/bump_version.sh
if ${{ inputs.is-internal }}; then
./ci-scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")"
else
./ci-scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}"
fi

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

- name: Create env
if: ${{ inputs.is-internal }}
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
run: mvn clean deploy -P ${{ inputs.profile }}
env:
SERVER_USERNAME: ${{ inputs.server-username }}
SERVER_PASSWORD: ${{ inputs.server-password }}
GPG_PASSPHRASE: ${{ inputs.gpg-passphrase }}

26 changes: 15 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@

<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.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -255,6 +244,21 @@
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<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>
</plugins>
</build>
</profile>
<profile>
<id>jfrog</id>
Expand Down
Loading