Skip to content

typeflows/standards-jvm

Repository files navigation

Standards Template Repository

A template repository for creating and publishing organisational standards using Typeflows and GitHub Packages.

🚀 Quick Start

  1. Use this template: Click "Use this template" to create your own standards repository
  2. Customise standards: Modify the files in src/main/resources/ to match your organisation's standards
  3. Publish: Create a tag to automatically publish to GitHub Packages
git tag v1.0.0
git push origin v1.0.0

That's it! Your standards package will be automatically published to GitHub Packages.

📦 What Gets Published

This template publishes a JAR containing your organisational standards files that other projects can consume. The standards are packaged as resources and can be extracted using Typeflows.

🔧 Consuming Published Standards

Add the GitHub Packages repository and dependency to your build.gradle.kts:

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/YOUR_ORG/YOUR_REPO")
        credentials {
            username = System.getenv("GITHUB_ACTOR")
            password = System.getenv("GITHUB_TOKEN")
        }
    }
}

dependencies {
    implementation("YOUR_ORG:standards:VERSION")
}

📁 Customising Standards

The standards files are located in src/main/resources/org/http4k/Http4kProjectStandards/typeflows/Http4kProjectStandards/.

Modify these files to match your organisation's standards:

  • .editorconfig - Editor configuration
  • .gitignore - Git ignore patterns
  • .java-version - Java version specification
  • gradle/ - Gradle wrapper files
  • And any other standard files your projects need

🔄 Release Process

Releases are fully automated using the included release script:

# Release a new version (must be on main branch with clean working directory)
./release.sh 1.2.0

# Release a pre-release version
./release.sh 2.0.0-beta.1

The release script will:

  1. Validate: Check semver format and git status
  2. Confirm: Show what will happen and ask for confirmation
  3. Tag: Create and push the version tag
  4. Trigger: GitHub Actions automatically builds and publishes
  5. Release: Creates GitHub release with installation instructions

🏗️ Template Features

  • Zero Configuration: Works out of the box with GitHub's built-in GITHUB_TOKEN
  • Automatic Publishing: Publishes to GitHub Packages on tag creation
  • No Signing Required: GitHub Packages handles authentication
  • Environment Aware: Uses GitHub environment variables for organisation/repository detection
  • Template Ready: Designed to be cloned and customized

🛠️ Technical Details

Publishing Configuration

The template automatically configures:

  • Group ID: Uses your GitHub organisation name
  • Artifact ID: Uses your repository name
  • Version: Extracted from the git tag (removes 'v' prefix if present)

Permissions

The workflow requires these permissions (automatically granted):

  • contents: write - For creating GitHub releases
  • packages: write - For publishing to GitHub Packages

Dependencies

The published package includes:

  • io.typeflows:typeflows-github - For GitHub integration
  • io.typeflows:typeflows-github-marketplace - For GitHub Actions marketplace integration

🔍 Package Discovery

Published packages appear in:

  • Your repository's "Packages" tab
  • GitHub's package registry at https://github.com/YOUR_ORG/YOUR_REPO/packages
  • Can be consumed by any project with appropriate GitHub token permissions

📋 Requirements

  • Java 21+
  • Gradle 8+
  • GitHub repository with Actions enabled
  • Public repository (for free GitHub Packages) or GitHub Pro/Teams for private repositories

🆘 Troubleshooting

Package Not Publishing

  • Ensure the tag follows the v* pattern (e.g., v1.0.0)
  • Check the Actions tab for workflow execution logs
  • Verify repository has packages permission enabled

Cannot Consume Package

  • Ensure you have a GitHub token with read:packages permission
  • Verify the repository/organisation name in the Maven URL
  • Check your credentials configuration

Permission Denied

  • Ensure your GitHub token has appropriate permissions
  • For private repositories, ensure you have access to both the repo and packages

📝 License

This template is provided under the Apache-2.0 license. Customise as needed for your organisation.

About

Template for Typeflows Configuration-as-Code, managed by Gradle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors