Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/configuration/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,13 @@ There are also action-specific environment variables, which you can see below.
### `fix-spec-file`

* `PACKIT_PROJECT_VERSION` — current version of the project (coming from `git describe`)
* `PACKIT_RPMSPEC_VERSION` — version that will be set in the specfile
* `PACKIT_RPMSPEC_RELEASE` — value for spec file's `%release` field which packit would set
* `PACKIT_PROJECT_COMMIT` — commit hash of the top commit
* `PACKIT_PROJECT_ARCHIVE` — expected name of the archive
* `PACKIT_RPMSPEC_RELEASE` — value for spec file's `%release` field which packit would set
* `PACKIT_PROJECT_BRANCH` — branch from which the SRPM is built
* `PACKIT_PROJECT_SNAPSHOTID` — snapshot identifier in format
`{current_time}.{sanitized_current_branch}{git_desc_suffix}`

### `create-archive`

Expand Down
33 changes: 31 additions & 2 deletions docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,22 @@ of the missing archive in the lookaside cache.
#### release_suffix

(*templated string*) String that can be used to override the default release suffix
generated by Packit. The suffix will be expanded, and you can use following variables:
generated by Packit. The suffix will be expanded, and you can use the following variables:

* `PACKIT_PROJECT_VERSION` - version from `git describe`
* `PACKIT_RPMSPEC_VERSION` - version that will be set in the specfile
* `PACKIT_RPMSPEC_RELEASE` - release from specfile
* `PACKIT_PROJECT_COMMIT` - commit SHA from which the SRPM is built
* `PACKIT_PROJECT_ARCHIVE` - expected name of the archive
* `PACKIT_PROJECT_BRANCH` - branch from which the SRPM is built
* `PACKIT_PROJECT_SNAPSHOTID` - snapshot identifier in format
`{current_time}.{sanitized_current_branch}{git_desc_suffix}`

Example usage:

release_suffix: "dev.{PACKIT_PROJECT_BRANCH}"

When unset, default release suffix that is generated by Packit is following:
When unset, the default release suffix generated by Packit is:

{original_release_number}.{current_time}.{sanitized_current_branch}{git_desc_suffix}

Expand All @@ -237,6 +241,31 @@ If you don't want the release to be modified at all, see [update_release](#updat
This option only applies to SRPM creation and doesn't affect [`propose_downstream`](#propose_downstream)
and [`pull_from_upstream`](#pull_from_upstream) jobs.

#### version_suffix

(*templated string*) String to append to the Version field in the RPM spec file. This is particularly useful for creating post-release snapshots following RPM versioning conventions. Supports the same variable expansion as [release_suffix](#release_suffix).

Example usage with post-release snapshot versioning (using caret notation):

version_suffix: "^{PACKIT_PROJECT_SNAPSHOTID}"

This would transform a version like `1.2.3` into `1.2.3^20231120173257.main.24.gabc123`, following the
[Snapshots section of the Fedora packaging guidelines](https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots).

:::caution Avoid duplicate snapshot IDs

When using `version_suffix` with `PACKIT_PROJECT_SNAPSHOTID`, consider disabling automatic Release updates to avoid duplicating the snapshot identifier in both fields (see [`update_release`](#update_release)):

version_suffix: "^{PACKIT_PROJECT_SNAPSHOTID}"
update_release: false

This updates Version with the snapshot suffix while preserving the Release from your spec file.

:::

This option only applies to SRPM creation and doesn't affect [`propose_downstream`](#propose_downstream)
and [`pull_from_upstream`](#pull_from_upstream) jobs.

#### files_to_sync

(*list of strings or dicts*) A list of relative paths to files in the upstream
Expand Down
Loading