Files

56 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2025-12-28 02:28:35 +01:00
# Composer Package Tools
2025-12-28 15:26:33 +01:00
This is a composer plugin to create zipballs, and publish them to Gitea.
2025-12-28 02:28:35 +01:00
2026-01-09 17:17:55 +01:00
## Install
Install globally using composer:
2025-12-28 02:28:35 +01:00
```bash
2026-01-09 17:17:55 +01:00
$ composer global repo add noccylabs composer https://dev.noccylabs.info/api/packages/noccylabs/composer
$ composer global require noccylabs/composer-package-plugin
```
## Usage
2025-12-28 02:28:35 +01:00
2026-01-09 17:17:55 +01:00
### Logging in to registry
```bash
2025-12-28 15:26:33 +01:00
$ composer package:login myserver.tld
2026-01-09 17:17:55 +01:00
```
### Building packages
Packages are built with the `package:build` command, or the more convenient alias
`package`.
2025-12-28 02:28:35 +01:00
2026-01-09 17:17:55 +01:00
```bash
2025-12-28 02:28:35 +01:00
# Create package by cloning into temporary directory
$ composer package
2026-01-09 17:17:55 +01:00
# Build zipball even if it exists
$ composer package --force
# Create and publish, and delete zipball afterwards
$ composer package --rm --publish gitea:myserver.tld
# Create and publish to another owner
$ composer package --publish gitea:myserver.tld:myowner
2025-12-28 15:26:33 +01:00
```
2025-12-28 02:28:35 +01:00
2026-01-09 17:17:55 +01:00
#### Dirty builds
Dirty builds are made directly from the source tree instead of from a clone of a
specific tag. You should avoid these as far as possible, but if for some reason
you need to build a package directly from your working copy while piggybacking
on the git version, pass `--dirty` to the `package:build` command.
### Publishing packages
2025-12-28 02:28:35 +01:00
2026-01-09 17:17:55 +01:00
If you like to manually publish a package (as opposed to passing `--publish` to
the `package:build` command) you can use the `package:publish` command.
```bash
# Publish latest zipball to another owner
$ composer package:publish gitea:myserver.tld:myowner
# Publish specific version
$ composer package:publish gitea:myserver.tld 1.0.0
```