Skip to content
Merged
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
102 changes: 102 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# GitHub Actions Workflows

This directory contains automated CI/CD workflows for the plugin-bootstrap project.

## Workflows

### build.yml - Continuous Integration

**Triggers:**
- Push to `master` or `main` branches
- Pull requests to `master` or `main` branches

**What it does:**
1. Checks out the code
2. Sets up JDK 11 (Temurin distribution)
3. Validates the Gradle wrapper for security
4. Runs `./gradlew clean build check` (compiles, runs tests)
5. Builds distribution packages (`.deb` and `.rpm`)

**Purpose:** Ensures code quality and that the project builds successfully on every commit and PR.

### release.yml - Release Automation

**Triggers:**
- Push of a version tag matching pattern `v*` (e.g., `v1.2.0`)

**What it does:**
1. Checks out the code with full history
2. Sets up JDK 11 (Temurin distribution)
3. Validates the Gradle wrapper
4. Runs `./gradlew clean build` (full build with tests)
5. Builds all distribution formats:
- Regular tar/zip archives
- Shadow (fat) tar/zip archives
- Debian package (`.deb`)
- RPM package (`.rpm`)
6. Extracts version from the tag
7. Creates a GitHub release with:
- Release name: "Release X.Y.Z"
- All distribution packages attached
- Auto-generated release notes from commits

**Purpose:** Automates the release process, ensuring consistent builds and making distribution packages immediately available.

## Creating a Release

To create a new release:

```bash
# 1. Update version and changelog (if needed)
# 2. Commit all changes
git add .
git commit -m "Prepare for release X.Y.Z"

# 3. Create and push the tag
git tag -a vX.Y.Z -m "Release version X.Y.Z"
git push origin main
git push origin vX.Y.Z
```

The release workflow will automatically:
- Build all packages
- Create the GitHub release
- Upload distribution files
- Make them available at: https://github.com/rundeck/plugin-bootstrap/releases

## Permissions

Both workflows require specific permissions:

- **build.yml**: Default permissions (read repository)
- **release.yml**: `contents: write` permission to create releases

These permissions are configured in each workflow file.

## Maintenance Notes

### Updating Actions

Keep actions up to date for security and features:
- `actions/checkout`: Currently v4
- `actions/setup-java`: Currently v4
- `gradle/wrapper-validation-action`: Currently v2
- `softprops/action-gh-release`: Currently v1

Check for updates: https://github.com/marketplace?type=actions

### Java Version

The project uses Java 11 as the minimum version. This is set in:
- Both workflow files
- `build.gradle` (`sourceCompatibility = 11.0`)
- Generated plugin templates

### Distribution Packages

The workflows build multiple package formats:
- **Regular distributions**: Standard tar/zip with dependencies separate
- **Shadow distributions**: Fat archives with all dependencies bundled
- **System packages**: `.deb` for Debian/Ubuntu, `.rpm` for RedHat/CentOS

Shadow distributions are recommended for most users as they're self-contained.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Test

on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2

- name: Build and Test
run: ./gradlew clean build check

- name: Build distribution packages
run: ./gradlew buildRpm buildDeb
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2

- name: Build with Gradle
run: ./gradlew clean build

- name: Build distribution packages
run: ./gradlew buildRpm buildDeb shadowDistZip shadowDistTar

- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
files: |
build/distributions/rundeck-plugin-bootstrap-*.tar
build/distributions/rundeck-plugin-bootstrap-*.zip
build/distributions/rundeck-plugin-bootstrap-shadow-*.tar
build/distributions/rundeck-plugin-bootstrap-shadow-*.zip
build/distributions/rundeck-plugin-bootstrap_*_all.deb
build/distributions/rundeck-plugin-bootstrap-*.noarch.rpm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ rundeck-plugin-bootstrap/
build/
*.iml
.DS_Store
temp/
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

91 changes: 91 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Changelog

All notable changes to the Rundeck Plugin Bootstrap project are documented in this file.

## [1.2] - 2026-02-03

### Added
- **Examples folder** with complete, working examples of all plugin types
- 8 Java plugin examples (Notification, WorkflowStep, WorkflowNodeStep, ResourceModelSource, LogFilter, NodeExecutor, Orchestrator, Option)
- 5 Script plugin examples (NodeExecutor, WorkflowStep, ResourceModelSource, FileCopier, Option)
- 1 UI plugin example
- **Regeneration script** (`generate-examples.sh`) to easily recreate all examples with one command
- **Examples README** documenting the purpose and usage of each example
- **GitHub Actions** CI/CD workflow replacing Travis CI
- Automated build and test on push/PR
- Gradle wrapper validation
- Artifact uploads for distribution packages
- **Better error handling** with proper exit codes and optional debug output
- **Examples .gitignore** to prevent committing build artifacts

### Changed
- **Updated Groovy** from 2.5.14 to 3.0.21 (matches current Rundeck)
- **Updated Spock** from 1.3-groovy-2.5 to 2.3-groovy-3.0
- **Updated picocli** from 4.0.0-alpha-2 to 4.7.5 (stable release)
- **Updated commons-text** from 1.4 to 1.11.0
- **Updated Gradle** wrapper from 7.2 to 7.6.4 (last stable 7.x)
- **Updated shadow plugin** from 7.1.0 to 7.1.2
- **Updated axion-release plugin** from 1.13.4 to 1.18.2
- **Updated Rundeck version** in templates from 5.0.2-20240212 to 5.7.0-20250101
- **Updated Groovy version** in templates from 3.0.9 to 3.0.21
- **Improved input validation** to preserve numbers in plugin names (e.g., "MyPlugin123" now stays as "myplugin123" instead of "myplugin")
- **Enhanced Generator.groovy** to use proper Callable<Integer> return type for exit codes
- **Bumped version** from 1.1 to 1.2
- **Updated README** with GitHub Actions badge and examples documentation

### Fixed
- **Duplicate import** in notification PluginSpec template (removed duplicate `import spock.lang.Specification`)
- **Error handling** that was swallowing stack traces - now prints to stderr with optional debug mode
- **Exit codes** - now properly returns 0 on success, 1 on failure

### Removed
- **Travis CI configuration** (`.travis.yml`) - replaced with GitHub Actions

## [1.1] - Previous Release

Initial working version with:
- Support for Java, Script, and UI plugins
- Multiple service types for each plugin type
- Template-based generation
- Basic testing

---

## Migration Notes

### From 1.1 to 1.2

1. **Groovy 3.0 Compatibility**: Generated plugins now use Groovy 3.0.21. If you have existing plugins generated with older versions, they should continue to work, but you may want to regenerate them to get the latest dependencies.

2. **Build System**: The project now uses Gradle 7.6.4. If you're building from source, your existing Gradle daemon may need to be stopped: `./gradlew --stop`

3. **CI/CD**: If you're maintaining a fork, update your CI to use GitHub Actions instead of Travis CI. The workflow file is at `.github/workflows/build.yml`.

4. **Examples**: A new `examples/` directory has been added. You can regenerate it anytime with `./generate-examples.sh`. This is especially useful for documentation purposes.

## Compatibility

- **Rundeck**: Compatible with Rundeck 3.x, 4.x, and 5.x
- **Java**: Requires Java 11 or later
- **Gradle**: Uses Gradle 7.6.4 (included via wrapper)
- **Groovy**: Generated plugins use Groovy 3.0.21

## Release Process

Releases are automated via GitHub Actions. To create a new release:

1. Update version in relevant files if needed
2. Update CHANGELOG.md with release notes
3. Commit changes
4. Create and push a version tag:
```bash
git tag -a v1.2.0 -m "Release version 1.2.0"
git push origin v1.2.0
```
5. GitHub Actions will automatically build and create the release with all distribution packages

The release workflow:
- Builds all distribution formats (tar, zip, deb, rpm)
- Creates a GitHub release
- Attaches distribution files
- Generates release notes from commits
Loading