Files
copr-publish/README.md
rob thijssen 22e1ba33be feat: initial copr-publish composite action
Wraps copr-cli submit/watch/download-build with per-chroot log
dumping as collapsible ::group:: blocks. Moves the logic previously
living at .gitea/scripts/copr-build.sh in helexa/cortex into a
reusable action so every consumer gets live log visibility and
consistent failure diagnostics.

Inputs: project, srpm (glob OK), copr-config (secret).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 12:30:48 +03:00

71 lines
2.5 KiB
Markdown

# copr-publish
Gitea composite action that submits a source RPM to [Fedora COPR](https://copr.fedorainfracloud.org/),
watches the build, and dumps each chroot's `builder-live.log` into the
CI output as collapsible groups.
## Why use this
`copr-cli build` by itself only prints status transitions
(`pending` / `importing` / `running` / `succeeded`). When a build fails
you have to click through to the COPR web UI to see the actual log.
This action:
- Submits with `--nowait` and captures the build ID.
- Prints a clickable `https://copr.fedorainfracloud.org/coprs/build/...` link so you can follow live.
- Watches the build to completion (blocks, propagates exit status).
- On completion, fetches each chroot's `builder-live.log` via
`copr-cli download-build` and emits them as `::group::` blocks.
- Fails CI if the build fails, but always dumps logs first.
## Requirements
The runner must already have:
- `copr-cli` on `PATH` (provided by the `copr-cli` RPM on Fedora runners).
- `grep -P` (PCRE, default on Fedora).
## Inputs
| Input | Required | Description |
| ------------- | -------- | -------------------------------------------------------------------------- |
| `project` | yes | COPR project in the form `<owner>/<project>`, e.g. `helexa/cortex`. |
| `srpm` | yes | Path or glob to the source RPM(s) to submit, e.g. `*.src.rpm`. |
| `copr-config` | yes | Contents of `~/.config/copr`. Fetch from <https://copr.fedorainfracloud.org/api/> and store as a repo or org secret. |
## Usage
```yaml
jobs:
publish:
runs-on: fedora
steps:
- uses: actions/download-artifact@v3
with:
name: my-srpm
- name: Publish to COPR
uses: https://git.lair.cafe/actions/copr-publish@v1
with:
project: helexa/cortex
srpm: '*.src.rpm'
copr-config: ${{ secrets.COPR_CONFIG }}
```
Note the fully-qualified URL in `uses:` — the Gitea instance's
`DEFAULT_ACTIONS_URL` points at github.com, so internal actions must be
referenced by absolute URL.
## Versioning
Pin to a major version tag (`@v1`) for automatic patch/minor updates.
Pin to an exact tag (`@v1.0.3`) to freeze.
## Obtaining `COPR_CONFIG`
1. Log in to <https://copr.fedorainfracloud.org/>.
2. Visit <https://copr.fedorainfracloud.org/api/>.
3. Copy the entire `[copr-cli]` config block.
4. Save as a Gitea secret named `COPR_CONFIG` in the consuming repo
(or at org level to share across all org repos).