Archive action
evin/archive@v1 expands file and glob inputs from the task working directory,
creates reproducible artifacts. tar.gz selects inputs directly from the task
configuration; deb, apk, and arch declare identity, payload layout,
dependencies, and scriptlets in typed with.package configuration.
include globs exclude globs layout + prefix tar + gzip
| | | |
v v v v
+----------+ +-----------+ +-------------+ +-----------+
| sources | ---> | filtered | ---> | stored path | ---> | artifact |
+----------+ +-----------+ +-------------+ +-----------+
The action packages regular files returned by the filesystem matcher. It does
not recursively add a matched directory; use a recursive glob such as
dist/**/* to select files below it.
Configuration
Unknown fields are rejected.
with field | Type | Default | Implemented contract |
|---|---|---|---|
format | string | tar.gz | tar.gz, deb, apk, or arch. |
path | string | required for tar.gz | Non-empty destination, resolved relative to the task cwd unless absolute. It must remain inside the workspace. |
output_dir | string | required for distro packages | Output directory relative to task cwd; Evin derives the conventional package filename. |
include | list of strings | required for tar.gz | Must contain at least one non-empty file path or glob. |
exclude | list of strings | [] | Non-empty glob patterns tested against the action's relative source path. This is normally relative to task cwd; flat-layout sources outside cwd use a workspace-relative fallback. |
prefix | string | none | Optional non-empty path joined in front of every stored archive path. |
layout | flat or relative | flat | Chooses whether a stored path keeps only its basename or its path relative to the task cwd. |
compression_level | integer | gzip default | Optional gzip level from 1 through 9. |
architecture | architecture | required for distro packages | Canonical target architecture, such as x86_64 or aarch64; it is translated to the package format spelling. |
package | object | required for distro packages | Typed identity, payload, and format targets; its resolved name is the release package ID. |
release | output reference | required for distro packages | Exact ${task.release} reference to a task listed in needs. |
include, exclude, prefix, layout, and compression_level are exclusive
to tar.gz. output_dir, architecture, package, and release are
exclusive to deb, apk, and arch; revision is rejected.
evin check reports an error if either format family mixes these keys.
Inline distro-package configuration
Package configuration is ordinary action configuration. Register a namespace
file in the workspace, then use namespace values to keep the identity and
paths consistent across format-specific tasks:
# .evin/workspace.flow
workspace:
include:
- .evin/release.flow
- .evin/packages.flow
# .evin/packages.flow
namespace:
name: packages
description: Native release artifacts
values:
package_name: evin
package_summary: EverInit workflow runner
package_maintainer: EverInit <[email protected]>
package_license: GPL-3.0-or-later
package_output_dir: dist
package_binary: target/release/evin
tasks:
deb:
needs: [release:bump]
steps:
- uses: evin/archive@v1
with:
format: deb
output_dir: ${package_output_dir}
architecture: x86_64
release: ${release:bump.release}
package:
name: ${package_name}
summary: ${package_summary}
maintainer: ${package_maintainer}
license: ${package_license}
payload:
- source: ${package_binary}
strip_prefix: target/release
destination: /usr/bin
mode: 0o755
targets:
deb:
depends: [libc6]
apk:
needs: [release:bump]
steps:
- uses: evin/archive@v1
with:
format: apk
output_dir: ${package_output_dir}
architecture: x86_64
release: ${release:bump.release}
package:
name: ${package_name}
summary: ${package_summary}
maintainer: ${package_maintainer}
license: ${package_license}
payload:
- source: ${package_binary}
strip_prefix: target/release
destination: /usr/bin
mode: 0o755
targets:
apk:
depends: [so:libc.musl-x86_64.so.1]
arch:
needs: [release:bump]
steps:
- uses: evin/archive@v1
with:
format: arch
output_dir: ${package_output_dir}
architecture: x86_64
release: ${release:bump.release}
package:
name: ${package_name}
summary: ${package_summary}
maintainer: ${package_maintainer}
license: ${package_license}
payload:
- source: ${package_binary}
strip_prefix: target/release
destination: /usr/bin
mode: 0o755
targets:
arch:
depends: [glibc]
optdepends: ["bash: shell completion support"]
with.package has flat common metadata. name, summary, maintainer, and
license are required; description and homepage are optional. payload
contains source, strip_prefix, destination, and optional mode mappings.
Payloads are regular files resolved from task cwd; every match must lie below
strip_prefix, destination escapes and collisions fail, and missing parent
directories are synthesized with 0755 permissions.
| Target | Fields |
|---|---|
targets.deb | depends, scripts.preinst, scripts.postinst, scripts.prerm, scripts.postrm |
targets.apk | depends, scripts.pre_install, scripts.post_install, scripts.pre_deinstall, scripts.post_deinstall |
targets.arch | depends, optdepends, provides, conflicts, replaces, backup, scripts.install |
Package versions and revisions come only from .evin/release-lock.json through
the bumper's immutable JSON output. The RepositoryPolicy releases.packages key must
equal the resolved with.package.name; it owns watched inputs and the
format-specific revision state.
| Format | Architecture spelling | Derived filename |
|---|---|---|
| DEB | x86_64 → amd64 | <name>_<version>-<revision>_<arch>.deb |
| APK | x86_64 → x86_64 | <name>-<version>-r<revision>.apk |
| Arch | x86_64 → x86_64 | <name>-<version>-<revision>-<arch>.pkg.tar.zst |
Migration
Register
.evin/packages.flowthroughworkspace.include.Move identity, payload, targets, and script paths into each task's typed
with.packageobject; remove the separately discovered metadata file.Add the matching package key, watched paths, and
deb/apk/archtargets to RepositoryPolicy.Give each package task a
needs: [release:bump]edge and userelease: ${release:bump.release}.
Every string in with.package uses Evin's standard ${value}, ${env.NAME}
and ${task.output} forms. Old {{...}} syntax is rejected. Script file
contents and payload bytes are never templated.
DEB generation emits deterministic debian-binary, control.tar.gz, and
data.tar.gz members, including control, sorted md5sums, and declared
maintainer scripts. APK generation emits unsigned deterministic v2 control and
data gzip streams with .PKGINFO and a datahash. Arch generation emits a
deterministic .pkg.tar.zst with .PKGINFO v2, .MTREE, and optional
.INSTALL; signing and repository index creation are outside this action.
The action does not generate PKGBUILD files, package repository databases,
signatures, or Arch .BUILDINFO metadata. Those release and repository
operations remain separate concerns.
All emitted tar entries are ordered by normalized path bytes, use root:root,
and have host ownership removed. Timestamps come from SOURCE_DATE_EPOCH, or
the Git HEAD commit epoch when it is absent; packaging fails if neither is
available.
The action's runtime loader resolves every string in with before execution;
generic preflight validates the same template syntax recursively.
values:
release_version: "1.2.0"
tasks:
package-linux:
stage: Release
cwd: .
steps:
- uses: evin/archive@v1
with:
path: "dist/evin-${release_version}-linux.tar.gz"
include:
- target/release/evin
- target/release/esh
- LICENSE
- THIRD_PARTY_NOTICES/**/*
exclude:
- THIRD_PARTY_NOTICES/**/*.tmp
prefix: "evin-${release_version}-linux"
layout: relative
compression_level: 9
Selection and path resolution
Each include entry is resolved independently. Duplicate selections of the
same source collapse when they produce the same stored path. Results are
ordered by stored path before they are passed to the tar writer.
The filesystem matcher uses the task cwd as the base for relative patterns
and returns files only. Absolute include patterns may select another path inside
the workspace. Both source and destination paths are lexically checked to
remain within the workspace. With layout: relative, every source must also be
expressible relative to the task cwd; otherwise the action fails with a
relative-path escape diagnostic. Flat layout instead falls back to a path
relative to the workspace before retaining only the basename.
Exclusions are evaluated after that relative source path is selected and before
its archive destination is calculated. They do not match the configured
prefix, because that prefix has not been applied yet.
Stored-path layouts
Given cwd: ., prefix: project-1.2.0, and these sources:
| Source | layout: relative | layout: flat |
|---|---|---|
target/release/project | project-1.2.0/target/release/project | project-1.2.0/project |
licenses/LICENSE | project-1.2.0/licenses/LICENSE | project-1.2.0/LICENSE |
prefix is optional. With no prefix, the paths are stored exactly as produced
by the selected layout.
Flat layout is convenient for a small release root, but basenames must be unique. These inputs fail rather than overwrite one another:
with:
path: dist/notices.tar.gz
include:
- client/LICENSE
- server/LICENSE
layout: flat
Execution order and failure boundaries
Validate the configuration. The action rejects unsupported formats, conflicting fields, empty patterns, invalid templates, and invalid compression levels.
Resolve sources and exclusions. It expands include globs, removes excluded paths, and enforces workspace and relative-layout boundaries.
Map stored paths. It applies
flatorrelativelayout, adds the optional prefix, deduplicates identical mappings, and rejects collisions.Publish the artifact. It creates parent directories, writes to a same-directory temporary file, syncs it, and atomically replaces the destination.
No-match handling occurs before a temporary file is opened. Encoding or sync failure removes that temporary file and preserves an existing destination. Successful artifacts are published as readable non-executable files on Unix.
Package-internal checksums and metadata are generated where their format
requires them. Public task outputs remain limited to path and size. With
verbose logging, the action also reports the input count and size beside the
final archive size. Debug logging adds a structured archive summary and one
record per input file with its stored path, byte size, and mode. For DEB, APK,
and Arch formats, these per-file records describe payload inputs; the package
format may add its own control files and metadata.
Dry runs
A dry run performs selection and mapping but does not create the archive.
| Condition | Result | Outputs |
|---|---|---|
| At least one file resolves | Successful verified plan | path is the configured resolved path; size is the string 0 |
| No file resolves and upstream dry-run uncertainty exists | Successful unverified plan | path is set; size is unknown |
| No file resolves and there is no upstream uncertainty | Failure: no files matched | no success outputs |
This distinction lets a downstream dry-run continue when an earlier virtual step would have created the inputs without claiming that the archive was actually inspected.
Outputs
| Output | Normal execution | Meaning |
|---|---|---|
path | Set after a successful archive | Resolved configuration value, not necessarily an absolute path |
size | Set when output metadata can be read | Final archive size in bytes, serialized as a string |
The normal path attempts to read destination metadata after creation. If that
metadata read fails, the action can still succeed without a size output.
Dependent tasks must declare this task in needs before using
${task.path} or ${task.size}.
action.evin/archive@v1 Create a reproducible archive or native package.
Configure archive output through with:.
action.evin/[email protected] Select the package to archive.
The package ID selects declared package metadata.