PHPackages                             metadrop/drupal-artifact-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. metadrop/drupal-artifact-builder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

metadrop/drupal-artifact-builder
================================

Helper to generate drupal artifacts

3.0.2(1mo ago)731.9k—5%3[3 issues](https://github.com/Metadrop/drupal-artifact-builder/issues)1PHP

Since Apr 28Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/Metadrop/drupal-artifact-builder)[ Packagist](https://packagist.org/packages/metadrop/drupal-artifact-builder)[ RSS](/packages/metadrop-drupal-artifact-builder/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (47)Used By (1)

Drupal artifact builder
=======================

[](#drupal-artifact-builder)

Helps generating artifacts for Drupal by wrapping all code into an artifact, and pushing it to the artifact remote repository.

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
- [CI integration](#ci-integration)
- [Upgrade from 1.x to 2.x](#upgrade-from-1x-to-2x)
- [Upgrade from 2.x to 3.x](#upgrade-from-2x-to-3x)

Installation
------------

[](#installation)

```
composer require metadrop/drupal-artifact-builder
```

### Configuration

[](#configuration)

Drupal artifact builder allow using a configuration file to create the artifact. Artifacts usually are executed using always the same parameters. So, a configuration file saves time adding those parameters every time the command is run.

Configuration file is placed at root (it can be changed through command line parameters). You cam copy the template to have an starting point:

```
cp vendor/metadrop/drupal-artifact-builder/.drupal-artifact-builder.yml.dist .drupal-artifact-builder.yml

```

#### Configuration properties

[](#configuration-properties)

- **commands**: Commands to run inside the artifact folder before packaging.

    Example:

    ```
    commands:
        - composer install --no-dev
        - cd web/themes/custom/foo/ && npm install && npm run production
    ```
- **repository**: Repository URL (git SSH / git HTTP URL).

    Example:

    ```
    repository: git@github.com:example/example-artifact.git
    ```
- **include**: Extra files or folders to include into the artifact.

    Example:

    ```
    include:
      - oauth
      - solr
    ```
- **author**: It will be the author used in git commits.

    Example:

    ```
    author: John Doe
    ```
- **branches\_map**: Key value map to git push source artifact branches to different artifact branches.

    Example:

    ```
    branches_map:
      develop:develop-build
    ```

This example will make push the artifacts coming from develop source branch to the develop-build artifact branch.

Usage
-----

[](#usage)

**Important**: Please note that Drupal Artifact Builder does not download Composer libraries or compile CSS assets. These tasks must be completed prior to running the command.

Builds the artifact and push the changes to git:

```
drupal-artifact-builder

```

Generate the artifact:

```
drupal-artifact-builder create

```

Push the created artifact to git:

```
drupal-artifact-builder git

```

### Parameters

[](#parameters)

- **branch**: Branch to create the artifact from / to. Required.
- **config**: Allow setting the configuration file. Defaults to .drupal-artifact-builder.yml

    ```
    drupal-artifact-builder git  folder/.drupal-artifact-builder.custom.yml

    ```
- **repository**: Selects the repository where the artifacts will be pushed.

    Examples:

    For the complete command (create + git):

    ```
    drupal-artifact-builder --repository git@example.com:example/example.git

    ```

    For the git command:

    ```
    drupal-artifact-builder git --repository git@example.com:example/example.git

    ```
- **include**: Allow adding more paths to the artifact.

    ```
    drupal-artifact-builder --repository git@example.com:example/example.git --include=oauth.json,mycustomapp

    ```

CI integration
--------------

[](#ci-integration)

### GitHub Actions

[](#github-actions)

A ready-to-use workflow is available at [`examples/github-actions.yml`](examples/github-actions.yml). Copy it into your Drupal project at `.github/workflows/deploy-artifact.yml` and follow these steps:

1. **Generate an SSH key pair** for the artifact repository:

    ```
    ssh-keygen -t ed25519 -C "artifact-deploy" -f artifact_deploy_key -N ""
    ```
2. **Add the public key** (`artifact_deploy_key.pub`) as a deploy key with write access in the artifact repository settings (Settings &gt; Deploy keys).
3. **Add the private key** (`artifact_deploy_key`) as a repository secret named `ARTIFACT_DEPLOY_KEY` in the source Drupal repository (Settings &gt; Secrets and variables &gt; Actions).
4. **Adjust the workflow** to your needs:

    - Update the `branches` list under `on.push` to match the branches you want to deploy.
    - Change the Docker image tag (`php8.3-node20`) to match your PHP and Node versions. Available tags are listed in the [drupal-artifact-builder-docker](https://github.com/metadrop/drupal-artifact-builder-docker) repository.

**Prerequisites**: Before running the workflow, make sure `.drupal-artifact-builder.yml` is correctly configured in your project root as described in the [Configuration](#configuration) section. At minimum, the `repository` key must point to the artifact repository.

The workflow runs inside the [`ghcr.io/metadrop/drupal-artifact-builder-docker`](https://github.com/metadrop/drupal-artifact-builder-docker) image, which provides PHP, Composer, Node, and Git out of the box. You can replace this image with any other, as long as it includes PHP, Composer, and Git.

Upgrade from 1.x to 2.x
-----------------------

[](#upgrade-from-1x-to-2x)

2.0.0 release brings breaking changes and the way to use drupal-artifact-builder changes.

These steps must be followed in order to upgrade to the 2.0.0 version:

1. Copy and configure .drupal-artifact-builder.yml:

    ```
    cp vendor/metadrop/drupal-artifact-builder/.drupal-artifact-builder.yml.dist .drupal-artifact-builder.yml

    ```
2. Change --extra-paths parameters to --include

    Before:

    ```
    drupal-artifact-builder --extra-paths solr
    ```

    Now:

    ```
    drupal-artifact-builder --include solr
    ```
3. Stop using GIT\_BRANCH environment variable, now it is --branch

    Before:

    ```
    GIT_BRANCH=develop drupal-artifact-builder
    ```

    Now:

    ```
    drupal-artifact-builder --branch develop
    ```

Upgrade from 2.x to 3.x
-----------------------

[](#upgrade-from-2x-to-3x)

To be able to bring composer libraries and compile the custom theme, configure `commands` in .drupal-artifact-builder.yml.

```
Example:
```yaml
commands:
    - composer install --no-dev
    - cd web/themes/custom/foo/ && npm install && npm run production
```

```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance83

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Recently: every ~2 days

Total

40

Last Release

43d ago

Major Versions

1.8.1 → 2.0.0-alpha12024-10-30

2.1.5 → 3.0.0-RC12026-05-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3202817?v=4)[Omar Mohamad - El Hassan Lopesino](/maintainers/omarlopesino)[@omarlopesino](https://github.com/omarlopesino)

---

Top Contributors

[![omarlopesino](https://avatars.githubusercontent.com/u/3202817?v=4)](https://github.com/omarlopesino "omarlopesino (76 commits)")[![juanjol](https://avatars.githubusercontent.com/u/4212917?v=4)](https://github.com/juanjol "juanjol (20 commits)")[![jorgetutor](https://avatars.githubusercontent.com/u/1230268?v=4)](https://github.com/jorgetutor "jorgetutor (3 commits)")

### Embed Badge

![Health badge](/badges/metadrop-drupal-artifact-builder/health.svg)

```
[![Health](https://phpackages.com/badges/metadrop-drupal-artifact-builder/health.svg)](https://phpackages.com/packages/metadrop-drupal-artifact-builder)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k17.1k1](/packages/phpactor-phpactor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
