Skip to content

Commit

Permalink
Merge pull request #555 from codeconsole/7.0.x-pre-release-support
Browse files Browse the repository at this point in the history
Allows pre-release maven central retrieval of github artifacts
  • Loading branch information
codeconsole authored Dec 13, 2024
2 parents 6a3b1db + 3f13663 commit 10093ea
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
Expand All @@ -26,6 +27,8 @@ jobs:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "🔨 Run Build"
id: build
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build --refresh-dependencies
- name: "📤 Upload Artifact"
if: success()
Expand All @@ -39,6 +42,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
Expand All @@ -53,6 +57,7 @@ jobs:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "📤 Publish Snapshot to repo.grails.org"
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: ./gradlew publish
Expand All @@ -62,6 +67,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
steps:
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
Expand All @@ -81,6 +87,7 @@ jobs:
if: steps.docs.outcome == 'success'
uses: grails/github-pages-deploy-action@v2
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
workflow_dispatch:
permissions:
contents: read
packages: read
jobs:
build_groovy:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -136,6 +137,7 @@ jobs:
run: sed -i 's|// mavenLocal() // Keep|mavenLocal() // Keep|' build.gradle
- name: "🔨 Build and test project using the locally built Groovy snapshot"
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run: >
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
outputs:
release_version: ${{ steps.release_version.outputs.value }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -30,6 +33,8 @@ jobs:
- name: "🧩 Run Assemble"
if: success()
run: ./gradlew assemble
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }}
- name: "📤 Upload Distribution"
if: success()
uses: actions/upload-artifact@v4
Expand All @@ -43,6 +48,7 @@ jobs:
- name: "📤 Publish to and close Sonatype staging repository"
id: publish
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GH_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
Expand All @@ -59,6 +65,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
Expand All @@ -75,6 +82,7 @@ jobs:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "🚀 Release Sonatype Staging Repository"
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
Expand All @@ -90,6 +98,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
Expand All @@ -105,6 +114,8 @@ jobs:
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "📖 Generate documentation"
env:
SITEMESH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew docs
- name: "📤 Publish documentation to Github Pages"
if: success()
Expand Down
13 changes: 12 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ext.set('signing.password', project.findProperty('signing.password') ?: System.g

apply plugin: 'idea'

allprojects {
allprojects { prj ->
repositories {
mavenCentral()
maven { url = 'https://repo.grails.org/grails/core' }
Expand All @@ -40,6 +40,17 @@ allprojects {
url = 'https://repository.apache.org/content/repositories/snapshots'
}
}

if (System.getenv("SITEMESH_MAVEN_PASSWORD") && prj.name == 'grails-plugin-gsp' && !sitemeshVersion.endsWith('-SNAPSHOT')) {
System.out.println("Adding Sitemesh Repo")
maven {
url = 'https://maven.pkg.github.com/codeconsole/grails-plugin-sitemesh3'
credentials {
username = 'DOES_NOT_MATTER'
password = System.getenv("SITEMESH_MAVEN_PASSWORD")
}
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ groovyVersion=4.0.24
jspApiVersion=4.0.0
jstlVersion=3.0.1
servletApiVersion=6.0.0
sitemeshVersion=7.0.0-SNAPSHOT
sitemeshVersion=7.0.0-M1
controllersRef=https://docs.grails.org/latest/ref/Controllers
commandLineRef=https://docs.grails.org/latest/ref/Command%20Line
grailsDocsVersion=7.0.0-SNAPSHOT
Expand Down

0 comments on commit 10093ea

Please sign in to comment.