v0.2.4

Documentation version

v0.2.4v0.3.2
en

Documentation language

en

Search documentation

ESC

Documentation search

What are you working on?

Find a guide, configuration option, action, or ESH topic.

Browse documentation
DocsArchive action

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 fieldTypeDefaultImplemented contract
formatstringtar.gztar.gz, deb, apk, or arch.
pathstringrequired for tar.gzNon-empty destination, resolved relative to the task cwd unless absolute. It must remain inside the workspace.
output_dirstringrequired for distro packagesOutput directory relative to task cwd; Evin derives the conventional package filename.
includelist of stringsrequired for tar.gzMust contain at least one non-empty file path or glob.
excludelist 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.
prefixstringnoneOptional non-empty path joined in front of every stored archive path.
layoutflat or relativeflatChooses whether a stored path keeps only its basename or its path relative to the task cwd.
compression_levelintegergzip defaultOptional gzip level from 1 through 9.
architecturearchitecturerequired for distro packagesCanonical target architecture, such as x86_64 or aarch64; it is translated to the package format spelling.
packageobjectrequired for distro packagesTyped identity, payload, and format targets; its resolved name is the release package ID.
releaseoutput referencerequired for distro packagesExact ${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.

TargetFields
targets.debdepends, scripts.preinst, scripts.postinst, scripts.prerm, scripts.postrm
targets.apkdepends, scripts.pre_install, scripts.post_install, scripts.pre_deinstall, scripts.post_deinstall
targets.archdepends, 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.

FormatArchitecture spellingDerived filename
DEBx86_64 → amd64<name>_<version>-<revision>_<arch>.deb
APKx86_64 → x86_64<name>-<version>-r<revision>.apk
Archx86_64 → x86_64<name>-<version>-<revision>-<arch>.pkg.tar.zst

Migration

  1. Register .evin/packages.flow through workspace.include.

  2. Move identity, payload, targets, and script paths into each task's typed with.package object; remove the separately discovered metadata file.

  3. Add the matching package key, watched paths, and deb/apk/arch targets to RepositoryPolicy.

  4. Give each package task a needs: [release:bump] edge and use release: ${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:

Sourcelayout: relativelayout: flat
target/release/projectproject-1.2.0/target/release/projectproject-1.2.0/project
licenses/LICENSEproject-1.2.0/licenses/LICENSEproject-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

  1. Validate the configuration. The action rejects unsupported formats, conflicting fields, empty patterns, invalid templates, and invalid compression levels.

  2. Resolve sources and exclusions. It expands include globs, removes excluded paths, and enforces workspace and relative-layout boundaries.

  3. Map stored paths. It applies flat or relative layout, adds the optional prefix, deduplicates identical mappings, and rejects collisions.

  4. 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.

ConditionResultOutputs
At least one file resolvesSuccessful verified planpath is the configured resolved path; size is the string 0
No file resolves and upstream dry-run uncertainty existsSuccessful unverified planpath is set; size is unknown
No file resolves and there is no upstream uncertaintyFailure: no files matchedno 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

OutputNormal executionMeaning
pathSet after a successful archiveResolved configuration value, not necessarily an absolute path
sizeSet when output metadata can be readFinal 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.

Page source: reference/actions/20.archive-action.5110.md