Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GitHub Workflow Configurations #424

Merged
merged 1 commit into from
Feb 2, 2024
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
10 changes: 4 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
strategy:
matrix:
java: ['11', '14', '17']
env:
WORKSPACE: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
Expand All @@ -33,12 +31,12 @@ jobs:
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: build
- name: Upload Artifacts
if: steps.build.outcome == 'success' && matrix.java == '11'
- name: Upload Distribution
if: success() && matrix.java == '11'
uses: actions/upload-artifact@v4
with:
name: grails-gsp.jar
path: build/libs/grails-gsp-*.jar
name: grails-gsp-SNAPSHOT.zip
path: ./**/build/libs/*
publish:
if: github.event_name == 'push'
needs: build
Expand Down
52 changes: 35 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: grails-gsp-${{ steps.release_version.outputs.value }}.zip
path: build/distributions/grails-gsp-${{ steps.release_version.outputs.value }}.zip
- name: Upload artifacts to the Github release
if: success()
id: upload_artifact
uses: Roang-zero1/github-upload-release-artifacts-action@master
with:
args: build/distributions/grails-gsp-${{ steps.release_version.outputs.value }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: ./**/build/libs/*
- name: Generate secring file
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
Expand All @@ -69,7 +61,34 @@ jobs:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
with:
arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository
arguments: |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeSonatypeStagingRepository
release:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: Nexus Staging Close And Release
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
with:
arguments: |
findSonatypeStagingRepository
releaseSonatypeStagingRepository
- name: Run post-release
if: success()
uses: micronaut-projects/github-actions/post-release@master
Expand All @@ -83,17 +102,16 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: Publish Documentation
id: docs
uses: gradle/gradle-build-action@v2
Expand All @@ -113,4 +131,4 @@ jobs:
FOLDER: build/docs
VERSION: ${{ needs.publish.outputs.release_version }}
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
COMMIT_NAME: "Puneet Behl"
Loading