Complete working examples for different project types.
Use case: Java/Spring Boot application with container
Contains:
- Maven application configuration
- Container build with multi-platform support
- GitHub Packages publishing
Good for:
- Spring Boot services
- Java microservices
- Backend APIs
Use case: Node.js/TypeScript application with container
Contains:
- NPM application configuration
- Container build with multi-platform support
- GitHub Packages publishing
- Optional npmjs.org publishing
Good for:
- Node.js services
- React/Vue/Angular apps
- Express APIs
Use case: Gradle/Android application
Contains:
- Gradle build configuration
- Android-specific tasks (APK, AAB)
- Version code auto-increment
- GitHub Packages publishing
Good for:
- Android applications
- Gradle-based Java projects
- Multi-module Gradle builds
4. Monorepo
Use case: Multiple artifacts in one repository
Contains:
- Multiple artifact configuration
- Mixed project types (Maven + NPM)
- Separate containers per artifact
- Shared library publishing to Maven Central
Good for:
- Microservices architecture
- Full-stack applications (backend + frontend)
- Projects with shared libraries
Includes sub-examples:
artifacts.yml- Basic monorepo (separate containers)multi-artifact-container.yml- Combined container
-
Navigate to example directory:
cd examples/maven-app/ # or npm-app, gradle-app, monorepo
-
Copy files to your project:
# Copy artifacts configuration cp artifacts.yml /path/to/your/project/.github/ # Copy workflow cp release-workflow.yml /path/to/your/project/.github/workflows/
-
Customize configuration:
- Update artifact
name - Adjust versions (java-version, node-version)
- Verify paths (working-directory, container-file)
- Update artifact
-
Create release:
git tag -s v1.0.0 -m "Release v1.0.0" git push origin v1.0.0
| Feature | Maven App | NPM App | Gradle App | Monorepo |
|---|---|---|---|---|
| Project Types | Maven | NPM | Gradle | Mixed |
| Containers | ✅ Single | ✅ Single | Optional | ✅ Multiple |
| Publishing | GitHub | GitHub | GitHub | GitHub + Maven Central |
| Complexity | Low | Low | Medium | High |
| Best For | Java APIs | Node services | Android apps | Microservices |
In any Maven example:
artifacts:
- name: my-lib
build-type: library # Required
require-authorization: true # Recommended
publish-to:
- github-packages
- maven-central # Add thisRequirements:
- Sonatype account
- MAVENCENTRAL_USERNAME secret
- MAVENCENTRAL_PASSWORD secret
See Publishing Guide for setup.
In NPM example:
artifacts:
- name: my-package
publish-to:
- github-packages
- npmjs # Add thisRequirements:
- npmjs.org account
- NPM_TOKEN secret
- Scoped package name:
@org/package
See Publishing Guide for setup.
Remove the containers: section:
artifacts:
- name: my-app
project-type: maven
working-directory: .
# containers: [] # Remove or comment outChange platform list:
containers:
- platforms: linux/amd64,linux/arm64 # Multi-platform (slower)
# or
- platforms: linux/amd64 # Single platform (faster)containers:
- enable-slsa: false # Disable SLSA provenance
- enable-sbom: false # Disable SBOM generation
- enable-scan: false # Disable Trivy scanningNote: Not recommended for production.
# Install yamllint
pip install yamllint
# Check syntax
yamllint .github/artifacts.ymlCreate .github/workflows/release-dev-workflow.yml:
on:
push:
branches: [feat/test-config]
jobs:
dev-release:
uses: diggsweden/reusable-ci/.github/workflows/release-dev-orchestrator.yml@main
with:
artifacts-config: .github/artifacts.yml
permissions:
contents: write
packages: write
secrets: inheritPush to test branch:
git checkout -b feat/test-config
git push origin feat/test-configgit tag -s v0.0.1-rc.1 -m "Test configuration"
git push origin v0.0.1-rc.1Problem: Workflow can't find configuration
Solution: Verify path in workflow:
with:
artifacts-config: .github/artifacts.yml # Must match actual pathProblem: Container build fails
Solution: Check container-file path:
containers:
- container-file: Containerfile # Must exist at this pathProblem: Missing publishing configuration
Solution: Add publish-to:
publish-to:
- github-packages # Explicit publishing target- Artifacts Reference - Complete field documentation
- Publishing Guide - Registry setup instructions