Skip to content
Merged

Dev #84

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
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.tmp/
16 changes: 16 additions & 0 deletions .github/actions/cache-keys/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Generate Cache Keys
description: Generate consistent cache keys for Gradle based on gradle files hash
outputs:
gradle-cache-key:
description: Gradle cache key
value: ${{ steps.generate.outputs.gradle-cache-key }}
deps-cache-key:
description: Dependencies cache key
value: ${{ steps.generate.outputs.deps-cache-key }}
runs:
using: composite
steps:
- name: Generate cache keys
id: generate
shell: bash
run: node ${{ github.action_path }}/dist/index.js
122 changes: 122 additions & 0 deletions .github/actions/cache-keys/dist/index.js

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions .github/actions/cache-keys/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@github-actions/cache-keys",
"type": "module",
"version": "1.0.0",
"private": true,
"description": "Generate consistent cache keys for Gradle",
"main": "./dist/index.js",
"scripts": {
"build": "cd ../.. && pnpm build",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@github-actions/shared": "workspace:*"
}
}
64 changes: 64 additions & 0 deletions .github/actions/cache-keys/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* Cache Keys Action
*
* Generates consistent cache keys for Gradle builds based on gradle files hash.
* The cache keys are prefixed with the runner OS for cross-platform compatibility.
*
* @module cache-keys
*/

import {
endGroup,
generateCacheKeys,
generateMarkdownTable,
info,
setFailed,
setOutput,
startGroup,
writeStepSummary,
} from '@github-actions/shared'

/**
* Main entry point for the action
*/
async function run(): Promise<void> {
try {
info('Generating cache keys for Gradle...')

startGroup('Cache Key Generation')

// Generate cache keys from workspace root
const cacheKeys = await generateCacheKeys('.')

info(`Gradle cache key: ${cacheKeys.gradleCache}`)
info(`Dependencies cache key: ${cacheKeys.depsCache}`)

endGroup()

// Set outputs
setOutput('gradle-cache-key', cacheKeys.gradleCache)
setOutput('deps-cache-key', cacheKeys.depsCache)

// Write step summary
const summaryTable = generateMarkdownTable(
['Cache Type', 'Key'],
[
['Gradle Cache', `\`${cacheKeys.gradleCache}\``],
['Dependencies Cache', `\`${cacheKeys.depsCache}\``],
],
)

await writeStepSummary(`## 🔑 Generated Cache Keys\n\n${summaryTable}\n\n### Files Included\n\n- \`gradle/wrapper/gradle-wrapper.properties\`\n- \`gradle/libs.versions.toml\`\n- \`build-logic/**/*.gradle.kts\`\n- \`build-logic/**/*.kt\`\n- \`build.gradle.kts\`\n- \`settings.gradle.kts\`\n- \`gradle.properties\``)

info('Cache keys generated successfully!')
} catch (error) {
if (error instanceof Error) {
setFailed(`Action failed: ${error.message}`)
} else {
setFailed('Action failed with unknown error')
}
}
}

// Run the action
run()
15 changes: 15 additions & 0 deletions .github/actions/cache-keys/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"dist",
"**/*.test.ts"
]
}
52 changes: 52 additions & 0 deletions .github/actions/create-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Create GitHub Release
description: Create a GitHub Release with generated release notes
inputs:
version:
description: 'Version to release (e.g., 1.0.0 or v1.0.0)'
required: true
group-id:
description: Maven group ID
required: false
default: io.github.truenine
artifacts:
description: Comma-separated list of artifacts
required: false
default: ''
draft:
description: Create as draft release
required: false
default: false
generate-notes:
description: Auto-generate release notes from commits
required: false
default: true
token:
description: GitHub token for API access
required: true
outputs:
release-id:
description: ID of the created release
value: ${{ steps.create.outputs.release-id }}
release-url:
description: URL of the created release
value: ${{ steps.create.outputs.release-url }}
release-created:
description: Whether a new release was created
value: ${{ steps.create.outputs.release-created }}
tag-name:
description: Tag name of the release
value: ${{ steps.create.outputs.tag-name }}
runs:
using: composite
steps:
- name: Create Release
id: create
shell: bash
env:
INPUT_VERSION: ${{ inputs.version }}
INPUT_GROUP-ID: ${{ inputs.group-id }}
INPUT_ARTIFACTS: ${{ inputs.artifacts }}
INPUT_DRAFT: ${{ inputs.draft }}
INPUT_GENERATE-NOTES: ${{ inputs.generate-notes }}
GITHUB_TOKEN: ${{ inputs.token }}
run: node ${{ github.action_path }}/dist/index.js
161 changes: 161 additions & 0 deletions .github/actions/create-release/dist/index.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions .github/actions/create-release/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@github-actions/create-release",
"type": "module",
"version": "1.0.0",
"private": true,
"description": "Create GitHub Release with generated release notes",
"main": "./dist/index.js",
"scripts": {
"build": "cd ../.. && pnpm build",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@actions/github": "^6.0.1",
"@github-actions/shared": "workspace:*"
}
}
Loading
Loading