Skip to content

Commit

Permalink
Refactor GitHub Actions workflows for deployment
Browse files Browse the repository at this point in the history
- Removed the obsolete `deploy.yaml` workflow file.
- Integrated deployment steps into the `main.yaml` workflow, ensuring a streamlined CI/CD process.
- Updated deployment job to trigger after the release job, maintaining necessary permissions and steps for JReleaser deployment.

These changes enhance the organization of workflows and improve the deployment process within the GitHub Actions configuration.
  • Loading branch information
ludorival committed Jan 9, 2025
1 parent 2a90807 commit 7a3e171
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 38 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/deploy.yaml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,31 @@ jobs:
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true

deploy:
needs: create-release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
checks: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6

- name: Deploy with JReleaser
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
run: |
./gradlew publish
./gradlew :pact-jvm-mock:jreleaserDeploy & ./gradlew :pact-jvm-mock-mockk:jreleaserDeploy & ./gradlew :pact-jvm-mock-spring:jreleaserDeploy & ./gradlew :pact-jvm-mock-mockito:jreleaserDeploy

0 comments on commit 7a3e171

Please sign in to comment.