Skip to content

Commit

Permalink
[skip ci] remove pre release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty committed Dec 20, 2024
1 parent 5369829 commit 3214c6d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 234 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@ on:
workflow_dispatch:
jobs:
build:
outputs:
found_skip_publish: ${{ steps.check_prevent_property.outputs.value }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
- name: "🔍 Check if we should skip publish"
id: check_prevent_property
run: |
if grep -q '^preventSnapshotPublish=true' gradle.properties; then
echo "value=true" >> $GITHUB_OUTPUT
else
echo "value=false" >> $GITHUB_OUTPUT
fi
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
Expand All @@ -47,7 +37,7 @@ jobs:
name: grails-gsp-SNAPSHOT.zip
path: ./**/build/libs/*
publish:
if: github.event_name == 'push' && needs.build.outputs.found_skip_publish != 'true'
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
permissions:
Expand All @@ -72,7 +62,7 @@ jobs:
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: ./gradlew publish
docs:
if: github.event_name == 'push' && needs.build.outputs.found_skip_publish != 'true'
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
permissions:
Expand Down
125 changes: 0 additions & 125 deletions .github/workflows/pre-release.yml

This file was deleted.

72 changes: 1 addition & 71 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,80 +12,10 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
packages: read
steps:
- name: "💥 Purge Existing Builds - org.grails.grails-gsp"
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/packages/maven/org.grails.grails-gsp || true
- name: "💥 Purge Existing Builds - org.grails.grails-taglib"
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/grails/packages/maven/org.grails.grails-taglib || true
- name: "💥 Purge Existing Builds - org.grails.grails-web-gsp-taglib"
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/packages/maven/org.grails.grails-web-gsp-taglib || true
- name: "💥 Purge Existing Builds - org.grails.grails-web-jsp"
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/packages/maven/org.grails.grails-web-jsp || true
- name: "💥 Purge Existing Builds - org.grails.grails-web-gsp"
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/packages/maven/org.grails.grails-web-gsp || true
- name: "💥 Purge Existing Builds - org.grails.grails-web-taglib"
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/packages/maven/org.grails.grails-web-taglib || true
- name: "💥 Purge Existing Builds - org.grails.plugins.gsp"
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/packages/maven/org.grails.plugins.gsp || true
- name: Checkout repository
uses: actions/checkout@v4
- name: "⎌ Revert Prevent Snapshot Publishing Flag"
run: |
sed -i "s/^preventSnapshotPublish.*$/preventSnapshotPublish\=false/" gradle.properties
- name: "📩 Commit flag to allow snapshot publishing"
run: |
git config user.name "${{ env.GIT_USER_NAME }}"
git config user.email "${{ env.GIT_USER_EMAIL }}"
git add gradle.properties
if ! git diff --cached --quiet; then
git commit -m "[skip ci] Restore Snapshot Publishing"
git push origin HEAD
else
echo "Publishing already enabled."
fi
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
Expand Down
27 changes: 5 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ buildscript {

ext {
isCiBuild = System.getenv().get("TRAVIS") == 'true' || (System.getenv().get("CI") as Boolean)
isGitHubRepoPublish = System.getenv("GITHUB_PUBLISH") == 'true'
isGrailsRepoPublish = project.projectVersion.endsWith('-SNAPSHOT') && !isGitHubRepoPublish
isReleaseVersion = !isGrailsRepoPublish && !isGitHubRepoPublish
isSnapshot = project.projectVersion.endsWith('-SNAPSHOT')
isReleaseVersion = !isSnapshot
}

group = "org.grails"
Expand Down Expand Up @@ -218,35 +217,21 @@ subprojects { subproject ->
tasks.findByName("assemble").finalizedBy(sourcesJar, javadocJar)

publishing {
if (isGrailsRepoPublish || isGitHubRepoPublish) {
if (isSnapshot) {
repositories {
maven {
credentials {
if(isGrailsRepoPublish) {
def u = System.getenv('ARTIFACTORY_USERNAME') ?: project.findProperty('artifactoryPublishUsername') ?: ''
def p = System.getenv('ARTIFACTORY_PASSWORD') ?: project.findProperty('artifactoryPublishPassword') ?: ''
username = u
password = p
}
else {
def u = System.getenv('GITHUB_USERNAME') ?: ''
def p = System.getenv('GITHUB_PASSWORD') ?: ''
username = u
password = p
}
}

if(isGrailsRepoPublish) {
if (isGrailsPlugin) {
url "https://repo.grails.org/grails/plugins3-snapshots-local"
} else {
url "https://repo.grails.org/grails/libs-snapshots-local"
}
}
else {
url 'https://maven.pkg.github.com/grails/grails-gsp'
}
}
}
}

Expand Down Expand Up @@ -283,23 +268,21 @@ subprojects { subproject ->

subproject.afterEvaluate {
signing {
required { isReleaseVersion || isGitHubRepoPublish }
required { isReleaseVersion }
sign publishing.publications.maven
}
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion || isGitHubRepoPublish }
onlyIf { isReleaseVersion }
}

//do not generate extra load on Nexus with new staging repository if signing fails
if(isReleaseVersion) {
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
}
}
}

def DOCUMENTATION_GROUP = 'Documentation'

Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ junit-jupiter.version=5.8.0
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.daemon=true

# Set when we are temporarily releasing, should be false unless we want to prevent
# snapshot or documentation publishes.
preventSnapshotPublish=true

0 comments on commit 3214c6d

Please sign in to comment.