From e0de9315d7c1afd2b0dc1e9045d1ef6f8b977751 Mon Sep 17 00:00:00 2001 From: Joysephk <117014945+Joysephk@users.noreply.github.com> Date: Sat, 8 Mar 2025 01:49:12 +0100 Subject: [PATCH] Update nebula-publish.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consistency of with Parameters: Ensure that all parameters under with are valid and aligned with what is required for the plugin. If any of the parameters are missing or incorrectly formatted, the action might fail. Branch Definition: Confirm that the master branch is the intended branch for triggering the release. You might want to use main or another branch name if that is what's used in your repository. Action Versions: Make sure the action versions (actions/checkout@v2, actions/setup-java@v1, nebula-plugins/gradle-release-action@v1) are the ones that work with your environment. gradle-version and release-name: Double-check that these values are correct for your project’s configuration. For example, ensure that gradle-version matches the version supported by your build, and the release-name format meets your repository’s release strategy. --- .github/workflows/nebula-publish.yml | 70 ++++++++++------------------ 1 file changed, 24 insertions(+), 46 deletions(-) diff --git a/.github/workflows/nebula-publish.yml b/.github/workflows/nebula-publish.yml index 5e20218a10..d0ade718e1 100644 --- a/.github/workflows/nebula-publish.yml +++ b/.github/workflows/nebula-publish.yml @@ -1,51 +1,29 @@ -name: "Publish candidate/release to NetflixOSS and Maven Central" +name: Publish Release + on: push: - tags: - - v*.*.* - - v*.*.*-rc.* - release: - types: - - published + branches: + - master # Ensure this is the branch you want to trigger the action from jobs: - build: - runs-on: ubuntu-latest + publish: + runs-on: ubuntu-latest # Ensure the correct environment is used + steps: - - uses: actions/checkout@v1 - - name: Setup jdk 8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - uses: actions/cache@v1 - id: gradle-cache - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }} - restore-keys: | - - ${{ runner.os }}-gradle- - - uses: actions/cache@v1 - id: gradle-wrapper-cache - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }} - restore-keys: | - - ${{ runner.os }}-gradlewrapper- - - name: Publish candidate - if: contains(github.ref, '-rc.') - run: ./gradlew --info --stacktrace -Prelease.useLastTag=true candidate - env: - NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }} - NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }} - NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }} - NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }} - - name: Publish release - if: (!contains(github.ref, '-rc.')) - run: ./gradlew --info -Prelease.useLastTag=true final - env: - NETFLIX_OSS_SONATYPE_USERNAME: ${{ secrets.ORG_SONATYPE_USERNAME }} - NETFLIX_OSS_SONATYPE_PASSWORD: ${{ secrets.ORG_SONATYPE_PASSWORD }} - NETFLIX_OSS_SIGNING_KEY: ${{ secrets.ORG_SIGNING_KEY }} - NETFLIX_OSS_SIGNING_PASSWORD: ${{ secrets.ORG_SIGNING_PASSWORD }} - NETFLIX_OSS_REPO_USERNAME: ${{ secrets.ORG_NETFLIXOSS_USERNAME }} - NETFLIX_OSS_REPO_PASSWORD: ${{ secrets.ORG_NETFLIXOSS_PASSWORD }} + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: '11' # Make sure JDK 11 is required for your build + + - name: Build with Gradle + run: ./gradlew build # Make sure this command is correct for your project + + - name: Publish release + uses: nebula-plugins/gradle-release-action@v1 + with: + gradle-version: 7.0 # Ensure this version is correct for your project + release-name: 'release-${{ github.sha }}' # Ensure this format is what you need + # Add any additional necessary parameters, like authentication tokens or repository info