@jjansen/semantic-release-gitlab-composer-package

1.0.15 • Public • Published

@jjansen/semantic-release-gitlab-composer-package

semantic-release plugin to publish a composer package to the gitlab package registry.

npm latest version

Step Description
verifyConditions Verify the presence of the composer.json file and Gitlab Token, API url and project id environment variables.
publish Publish the composer package to the gitlab package registry.

Install

$ npm install @jjansen/semantic-release-gitlab-composer-package -D

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@jjansen/semantic-release-gitlab-composer-package"]
}

Configuration

Environment variables

Variable Description
CI_JOB_TOKEN or GITLAB_TOKEN The Gitlab access token created via e.g personal access tokens
CI_API_V4_URL or GITLAB_API_URL The Gitlab API root URL (intended for v4) e.g. https://gitlab.company.com/api/v4
CI_PROJECT_ID or GITLAB_PROJECT_ID The Gitlab project id used to publish the composer package to.

Keep in mind that the Gitlab predefined CI/CD variables win over the environment variables.

Plugin Configuration

Alternatively, the gitlab API URL (gitlabApiUrl) and the project id (gitlabProjectId) can be set via plugin config.

However, the environment variables win over the plugin config. Also, the access token needs to be defined as environment variable for security reasons.

Examples

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "@jjansen/semantic-release-gitlab-composer-package",
      {
        "gitlabApiUrl": "https://www.gitlab.company.de/api/v4",
        "gitlabProjectId": "123"
      }
    ]
  ]
}

Notes

Access token

The access token needs permissions to publish to the package registry. Normally the gitlab predefined job token has enough permissions granted.

Publish composer URL

The URL for publishing to the gitlab package registry is directly from the gitlab docs: ${gitlabApiUrl}/projects/${gitlabProjectId}/packages/composer

Package Sidebar

Install

npm i @jjansen/semantic-release-gitlab-composer-package

Weekly Downloads

23

Version

1.0.15

License

MIT

Unpacked Size

8.11 kB

Total Files

6

Last publish

Collaborators

  • jjansen