This repository contains reusable GitHub Actions workflows for MikoPBX module development. It provides standardized processes for building, testing, and publishing MikoPBX modules.
- Automated versioning (X.YY format)
- GitHub Release creation
- Optional publishing to files.miko.ru and releases.mikopbx.com
- Docker-based build environment
- Composer dependencies handling
- Changelog generation
The extension-publish workflow accepts the following inputs:
Input | Description | Type | Default |
---|---|---|---|
initial_version |
Initial version for the module (e.g., "1.70") | string | - |
Input | Description | Type | Default |
---|---|---|---|
custom_build_steps |
Custom build steps to execute during build process, including Docker builds | string | '' |
Secret | Description |
---|---|
MIKO_LIC_REST_VENDOR_ID |
Vendor ID for publishing releases on releases.mikopbx.com |
MIKO_LIC_REST_API_KEY |
API key for licensing on releases.mikopbx.com |
MIKO_LIC_HOSTNAME |
Releases server hostname for publishing on releases.mikopbx.com |
OWNCLOUD_AUTH |
Authentication for storage on files.miko.ru |
WEBDAV_ROOT |
WebDAV root path on files.miko.ru |
SHARE_API_URL |
Share API URL on files.miko.ru |
For modules that don't require custom build steps, use this basic configuration:
Create .github/workflows/build.yml
in your module repository:
name: Build and Publish
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
uses: mikopbx/.github-workflows/.github/workflows/extension-publish.yml@master
with:
initial_version: "1.50" # Set your module's initial version
secrets: inherit # Automatically passes all available secrets
For modules requiring custom compilation or build steps, use the custom_build_steps
parameter. This allows you to:
- Use Docker containers for isolated builds
- Compile binary components
- Run specific build tools
- Execute custom build scripts
jobs:
build:
uses: mikopbx/.github-workflows/.github/workflows/extension-publish.yml@master
with:
initial_version: "1.70"
custom_build_steps: |
cd $GITHUB_WORKSPACE/module
make build
chmod +x bin/
jobs:
build:
uses: mikopbx/.github-workflows/.github/workflows/extension-publish.yml@master
with:
initial_version: "1.70"
custom_build_steps: |
cd $GITHUB_WORKSPACE/module
# Build custom Docker image
docker build -t custom-builder -f Dockerfile.build .
# Run compilation
docker run --rm \
-v $GITHUB_WORKSPACE/module:/build \
-w /build \
custom-builder \
bash -c "make && make install"
jobs:
build:
uses: mikopbx/.github-workflows/.github/workflows/extension-publish.yml@master
with:
initial_version: "1.70"
custom_build_steps: |
cd $GITHUB_WORKSPACE/module
# C++ compilation
docker run --rm \
-v $GITHUB_WORKSPACE/module:/build \
-w /build \
gcc:latest \
bash -c "g++ -o bin/app src/main.cpp"
# Go compilation
docker run --rm \
-v $GITHUB_WORKSPACE/module:/build \
-w /build \
golang:1.21 \
bash -c "cd cmd && go build -o ../bin/tool"
Create or update module.json
in your module's src directory:
{
"name": "Your Module Name",
"version": "1.50",
"min_pbx_version": "2024.1.22",
"release_settings": {
"publish_release": true, // Enable/disable publishing to files.miko.ru and releases.mikopbx.com
"changelog_enabled": true, // Enable/disable changelog generation
"create_github_release": true // Enable/disable GitHub release creation
}
}
When using custom build steps:
-
File Structure:
- Place build-related files (Dockerfile.build, Makefile, etc.) in your module repository
- Ensure compiled artifacts are placed in the correct location for packaging
-
Docker Considerations:
- Use
$GITHUB_WORKSPACE/module
as the mount point for your module code - Clean up containers and images after use
- Consider using Docker build cache for faster builds
- Use
-
Environment Variables:
- Access to all GitHub Actions environment variables
- Can pass additional variables to Docker containers
-
Best Practices:
- Keep Dockerfiles in your module repository
- Document build requirements clearly
- Test custom build steps locally before committing
The workflow executes in this order:
- Repository checkout
- Module validation
- Version management
- Environment setup
- Dependency handling
- Custom build steps (if specified)
- Package creation
- Publishing and release
OWNCLOUD_AUTH
: Authentication for files.miko.ruMIKO_LIC_REST_VENDOR_ID
: Vendor ID for releases.mikopbx.comMIKO_LIC_REST_API_KEY
: API key for releases.mikopbx.comMIKO_LIC_HOSTNAME
: MikoPBX release server hostnameWEBDAV_ROOT
: WebDAV root URL for files.miko.ruSHARE_API_URL
: Share API URL for files.miko.ru
-
Versioning:
- Uses X.YY format (e.g., 1.50, 1.51, 1.52)
- Automatically increments minor version
- Initial version is set in workflow file
-
Build Process:
- Uses Docker container for consistent build environment
- Handles Composer dependencies if enabled in module.json
- Updates version in module.json
-
Release Process:
- Creates GitHub release (if enabled)
- If
publish_release
is true:- Uploads to files.miko.ru
- Publishes to releases.mikopbx.com
- Generates changelog (if enabled)
{
"release_settings": {
"publish_release": true, // Enable/disable publishing to MikoPBX platforms
"changelog_enabled": true, // Enable/disable changelog generation
"create_github_release": true // Enable/disable GitHub release creation
}
}
- Fork the repository
- Create a feature branch
- Submit a pull request
Test your changes by referencing your branch in the module's workflow:
jobs:
build:
uses: mikopbx/.github-workflows/.github/workflows/extension-publish.yml@your-branch
Common issues and solutions:
-
Version not incrementing:
- Check initial_version in workflow file
- Verify previous releases on GitHub
-
Upload failures:
- Verify organization secrets
- Check module.json settings
- Review action logs for specific errors
-
Secrets Configuration:
- All secrets should be configured at the organization or repository level
- Use
secrets: inherit
to automatically pass all secrets to the workflow - Ensure all required secrets are available before running the workflow
-
Custom Build Steps:
- Executed after dependency handling and before package creation
- Have access to full GitHub Actions environment
- Can use Docker for isolated builds
- Should place artifacts in the correct module directories
-
Working Directory:
- Base:
$GITHUB_WORKSPACE
- Module:
$GITHUB_WORKSPACE/module
- Build artifacts should be placed in appropriate module directories
- Base:
-
Environment:
- Runner: Ubuntu latest
- Docker support available
- Full access to GitHub Actions environment variables
For issues or questions about:
- Workflow configuration: Open an issue in this repository
- Module-specific build problems: Open an issue in the module's repository
- Create issues for bugs and feature requests
- Submit pull requests with improvements
- Follow existing code style and conventions
This project is licensed under the MIT License - see the LICENSE file for details.