1.0.15 • Published 4 months ago

@jjansen/semantic-release-gitlab-composer-package v1.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

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

npm latest version

StepDescription
verifyConditionsVerify the presence of the composer.json file and Gitlab Token, API url and project id environment variables.
publishPublish 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

VariableDescription
CI_JOB_TOKEN or GITLAB_TOKENThe Gitlab access token created via e.g personal access tokens
CI_API_V4_URL or GITLAB_API_URLThe Gitlab API root URL (intended for v4) e.g. https://gitlab.company.com/api/v4
CI_PROJECT_ID or GITLAB_PROJECT_IDThe 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

1.0.15

4 months ago

1.0.14

4 months ago

1.0.13

4 months ago

1.0.12

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago