Replace occurrances of gradle-build-action

- Mostly with `setup-gradle`
- Some with `gradle-actions`
This commit is contained in:
daz
2024-01-25 12:28:05 -07:00
parent 930d449ff7
commit a628cf9f2e
24 changed files with 93 additions and 111 deletions

View File

@@ -1,11 +1,11 @@
{
"name": "gradle-build-action",
"name": "gradle-actions",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "gradle-build-action",
"name": "gradle-actions",
"version": "1.0.0",
"hasInstallScript": true,
"license": "MIT",

View File

@@ -1,5 +1,5 @@
{
"name": "gradle-build-action",
"name": "gradle-actions",
"version": "1.0.0",
"private": true,
"description": "Execute Gradle Build",
@@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/gradle/gradle-build-action.git"
"url": "git+https://github.com/gradle/actions.git"
},
"keywords": [
"github",

View File

@@ -11,7 +11,7 @@ import {GradleHomeEntryExtractor, ConfigurationCacheEntryExtractor} from './cach
const RESTORED_CACHE_KEY_KEY = 'restored-cache-key'
export const META_FILE_DIR = '.gradle-build-action'
export const META_FILE_DIR = '.setup-gradle'
export class GradleStateCache {
private cacheName: string
@@ -185,7 +185,7 @@ export class GradleStateCache {
private initializeGradleUserHome(): void {
// Create a directory for storing action metadata
const actionCacheDir = path.resolve(this.gradleUserHome, '.gradle-build-action')
const actionCacheDir = path.resolve(this.gradleUserHome, META_FILE_DIR)
fs.mkdirSync(actionCacheDir, {recursive: true})
this.copyInitScripts()
@@ -199,11 +199,11 @@ export class GradleStateCache {
const initScriptsDir = path.resolve(this.gradleUserHome, 'init.d')
fs.mkdirSync(initScriptsDir, {recursive: true})
const initScriptFilenames = [
'gradle-build-action.build-result-capture.init.gradle',
'gradle-build-action.build-result-capture-service.plugin.groovy',
'gradle-build-action.github-dependency-graph.init.gradle',
'gradle-build-action.github-dependency-graph-gradle-plugin-apply.groovy',
'gradle-build-action.inject-develocity.init.gradle'
'gradle-actions.build-result-capture.init.gradle',
'gradle-actions.build-result-capture-service.plugin.groovy',
'gradle-actions.github-dependency-graph.init.gradle',
'gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy',
'gradle-actions.inject-develocity.init.gradle'
]
for (const initScriptFilename of initScriptFilenames) {
const initScriptContent = this.readResourceFileAsString('init-scripts', initScriptFilename)

View File

@@ -116,7 +116,7 @@ export function generateCachingReport(listener: CacheListener): string {
return `
<details>
<summary><h4>Caching for gradle-build-action was ${listener.cacheStatus} - expand for details</h4></summary>
<summary><h4>Caching for Gradle actions was ${listener.cacheStatus} - expand for details</h4></summary>
${renderEntryTable(entries)}
<h5>Cache Entry Details</h5>

View File

@@ -40,7 +40,7 @@ async function addPRComment(jobSummary: string): Promise<void> {
const pull_request_number = context.payload.pull_request.number
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`)
const prComment = `<h3>Job Summary for gradle-build-action</h3>
const prComment = `<h3>Job Summary for Gradle</h3>
<h5>${github.context.workflow} :: <em>${github.context.job}</em></h5>
${jobSummary}`

View File

@@ -169,7 +169,7 @@ async function httpGetGradleVersions(url: string): Promise<GradleVersionInfo[]>
}
async function httpGetString(url: string): Promise<string> {
const httpClient = new httpm.HttpClient('gradle/gradle-build-action')
const httpClient = new httpm.HttpClient('gradle/actions')
const response = await httpClient.get(url)
return response.readBody()
}

View File

@@ -5,7 +5,7 @@ import org.gradle.util.GradleVersion
// Can't use settingsEvaluated since this script is applied inside a settingsEvaluated handler
// But projectsEvaluated is good enough, since the build service won't catch configuration failures anyway
projectsEvaluated {
def projectTracker = gradle.sharedServices.registerIfAbsent("gradle-build-action-buildResultsRecorder", BuildResultsRecorder, { spec ->
def projectTracker = gradle.sharedServices.registerIfAbsent("gradle-action-buildResultsRecorder", BuildResultsRecorder, { spec ->
spec.getParameters().getRootProjectName().set(gradle.rootProject.name)
spec.getParameters().getRootProjectDir().set(gradle.rootProject.rootDir.absolutePath)
spec.getParameters().getRequestedTasks().set(gradle.startParameter.taskNames.join(" "))
@@ -59,7 +59,7 @@ abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
}
} catch (Exception e) {
println "\ngradle-build-action failed to write build-results file. Will continue.\n> ${e.getLocalizedMessage()}"
println "\ngradle action failed to write build-results file. Will continue.\n> ${e.getLocalizedMessage()}"
}
}
}

View File

@@ -82,7 +82,7 @@ def captureUsingBuildFinished(gradle, invocationId) {
def captureUsingBuildService(settings, invocationId) {
gradle.ext.invocationId = invocationId
apply from: 'gradle-build-action.build-result-capture-service.plugin.groovy'
apply from: 'gradle-actions.build-result-capture-service.plugin.groovy'
}
class BuildResults {
@@ -137,7 +137,7 @@ class BuildResults {
}
} catch (Exception e) {
println "\ngradle-build-action failed to write build-results file. Will continue.\n> ${e.getLocalizedMessage()}"
println "\ngradle action failed to write build-results file. Will continue.\n> ${e.getLocalizedMessage()}"
}
}
}

View File

@@ -30,7 +30,7 @@ if (isTopLevelBuild) {
println "Generating dependency graph into '${reportFile}'"
}
apply from: 'gradle-build-action.github-dependency-graph-gradle-plugin-apply.groovy'
apply from: 'gradle-actions.github-dependency-graph-gradle-plugin-apply.groovy'
/**
* Using the supplied jobCorrelator value:

View File

@@ -56,7 +56,7 @@ def DEVELOCITY_PLUGIN_ID = 'com.gradle.enterprise'
def DEVELOCITY_PLUGIN_CLASS = 'com.gradle.enterprise.gradleplugin.GradleEnterprisePlugin'
def DEVELOCITY_EXTENSION_CLASS = 'com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension'
def CI_AUTO_INJECTION_CUSTOM_VALUE_NAME = 'CI auto injection'
def CI_AUTO_INJECTION_CUSTOM_VALUE_VALUE = 'gradle-build-action'
def CI_AUTO_INJECTION_CUSTOM_VALUE_VALUE = 'gradle-actions'
def CCUD_PLUGIN_ID = 'com.gradle.common-custom-user-data-gradle-plugin'
def CCUD_PLUGIN_CLASS = 'com.gradle.CommonCustomUserDataGradlePlugin'

View File

@@ -24,7 +24,7 @@ export async function setup(): Promise<void> {
// Bypass setup on all but first action step in workflow.
if (process.env[GRADLE_SETUP_VAR]) {
core.info('Gradle setup only performed on first gradle-build-action step in workflow.')
core.info('Gradle setup only performed on first gradle/actions step in workflow.')
return
}
// Record setup complete: visible to all subsequent actions and prevents duplicate setup
@@ -48,7 +48,7 @@ export async function setup(): Promise<void> {
export async function complete(): Promise<void> {
if (!core.getState(GRADLE_SETUP_VAR)) {
core.info('Gradle setup post-action only performed for first gradle-build-action step in workflow.')
core.info('Gradle setup post-action only performed for first gradle/actions step in workflow.')
return
}
core.info('In post-action step')

View File

@@ -5,7 +5,7 @@ import groovy.json.JsonSlurper
import static org.junit.Assume.assumeTrue
class TestBuildResultRecorder extends BaseInitScriptTest {
def initScript = 'gradle-build-action.build-result-capture.init.gradle'
def initScript = 'gradle-actions.build-result-capture.init.gradle'
def "produces build results file for build with #testGradleVersion"() {
assumeTrue testGradleVersion.compatibleWithCurrentJvm

View File

@@ -5,7 +5,7 @@ import org.gradle.util.GradleVersion
import static org.junit.Assume.assumeTrue
class TestDependencyGraph extends BaseInitScriptTest {
def initScript = 'gradle-build-action.github-dependency-graph.init.gradle'
def initScript = 'gradle-actions.github-dependency-graph.init.gradle'
static final TestGradleVersion GRADLE_5_1 = new TestGradleVersion(GradleVersion.version('5.1.1'), 8, 12)
static final TestGradleVersion GRADLE_7_0 = new TestGradleVersion(GradleVersion.version('7.0.1'), 8, 12)

View File

@@ -8,7 +8,7 @@ import static org.junit.Assume.assumeTrue
class TestDevelocityInjection extends BaseInitScriptTest {
static final List<TestGradleVersion> CCUD_COMPATIBLE_VERSIONS = ALL_VERSIONS - [GRADLE_3_X]
def initScript = 'gradle-build-action.inject-develocity.init.gradle'
def initScript = 'gradle-actions.inject-develocity.init.gradle'
private static final GradleVersion GRADLE_6 = GradleVersion.version('6.0')