Skip to content

Commit

Permalink
Use setup-java action directly in prepare release and use env approach (
Browse files Browse the repository at this point in the history
  • Loading branch information
srknzl authored Jun 12, 2024
1 parent 294fdd2 commit 7401513
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,22 @@ jobs:
with:
ref: "${{ env.TAG }}"
- name: Setup JDK
uses: ./.github/actions/setup-jdk
uses: actions/setup-java@v4
with:
server-id: release-repository
java-version: 17
distribution: 'temurin'
cache: 'maven'
server-id: 'release-repository'
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Deploy release
run: ./mvnw deploy -Prelease --batch-mode -DskipTests -DretryFailedDeploymentCount=3 -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: ./mvnw deploy -Prelease --batch-mode -DskipTests -DretryFailedDeploymentCount=3
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_OSS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_OSS_PASSWORD }}

MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: ./.github/actions/setup-jdk
uses: actions/setup-java@v4
with:
server-id: snapshot-repository
java-version: 17
distribution: 'temurin'
cache: 'maven'
server-id: 'snapshot-repository'
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Deploy snapshot
run: ./mvnw deploy -Prelease-snapshot --batch-mode --update-snapshots -DskipTests -DretryFailedDeploymentCount=3
env:
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,29 @@ jobs:
with:
token: "${{ secrets.GH_PAT }}"
- name: Setup JDK
uses: ./.github/actions/setup-jdk
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
server-id: 'snapshot-repository'
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Prepare release
run: |
if [ -n "${{ github.event.inputs.next-version }}" ]; then
EXTRA_ARGS=-DdevelopmentVersion=${{ github.event.inputs.next-version }}
fi
git config user.name "devopsHazelcast"
git config user.email "<[email protected]>"
./mvnw --batch-mode release:prepare -Prelease -Darguments="-DskipTests" -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} $EXTRA_ARGS
./mvnw --batch-mode release:clean -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }}
./mvnw --batch-mode release:prepare -Prelease -Darguments="-DskipTests" $EXTRA_ARGS
./mvnw --batch-mode release:clean
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_OSS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_OSS_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Push changes
run: |
git push
Expand Down

0 comments on commit 7401513

Please sign in to comment.