Skip to content

Commit

Permalink
Fix publishing of node package
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Nov 19, 2024
1 parent 8862920 commit bafb2f0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The configuration file is `.github/publish.yaml`, the schema is `https://raw.git

Dry run publish: `GITHUB_REF=... tag-publish --dry-run ...`

### To pypi
### Python package to pypi repository

Minimum configuration:

Expand Down Expand Up @@ -172,7 +172,7 @@ build: ## Build the Docker images
docker build --build-arg=VERSION=$(VERSION) --tag=$(GITHUB_REPOSITORY) .
```

### To Docker registry
### Docker image to registry

The minimal config is like this:

Expand Down Expand Up @@ -222,14 +222,28 @@ If the `ci/dpkg-versions.yaml` or `.github/dpkg-versions.yaml` file is present,

The versions will be updated by [GHCI](https://github.com/camptocamp/github-app-geo-project/) application.

### Node package to npm repository

Minimum configuration:

```yaml
node:
packages:
- {}
```

If the repository server is `npm.pkg.github.com` we will do a login using `GITHUB_TOKEN`.

By default the package will be published only on tag.

### HELM

The minimal config is like this:

```yaml
helm:
folders:
- .
packages:
- {}
```

This will publish the `helm` charts in the current folder using [chart releaser](https://github.com/helm/chart-releaser).
Expand Down
10 changes: 6 additions & 4 deletions tag_publish/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ def _handle_node_publish(
node_config = config.get("node", {})
if node_config:
for package in node_config.get("packages", []):
if package.get("group", tag_publish.configuration.PIP_PACKAGE_GROUP_DEFAULT) == group:
if package.get("group", tag_publish.configuration.NODE_PACKAGE_GROUP_DEFAULT) == group:
publish = version_type in node_config.get(
"versions", tag_publish.configuration.PYPI_VERSIONS_DEFAULT
"versions", tag_publish.configuration.NODE_VERSIONS_DEFAULT
)
folder = package.get("folder", tag_publish.configuration.PYPI_PACKAGE_FOLDER_DEFAULT)
for repo_name, repo_config in node_config.get("repository", {}).items():
folder = package.get("folder", tag_publish.configuration.NODE_PACKAGE_FOLDER_DEFAULT)
for repo_name, repo_config in node_config.get(
"repository", tag_publish.configuration.NODE_REPOSITORY_DEFAULT
).items():
if dry_run:
print(
f"{'Publishing' if publish else 'Checking'} '{folder}' to {repo_name}, "
Expand Down

0 comments on commit bafb2f0

Please sign in to comment.