apt-repo-action/action.yml
morph027 b891498be5
fix reprepro repo
Signed-off-by: morph027 <[email protected]>
2026-11-02 11:28:07 +01:00

141 lines
4.5 KiB
YAML

---
# yamllint disable rule:line-length
name: Create APT repository
description: Create APT repository using reprepro
branding:
icon: package
color: purple
inputs:
repo-name:
description: >-
Repository name.
required: true
scan-dir:
description: >-
Scan this directory for packages to include in the repo.
If unset, defaults to ${PWD}.
keyring-name:
description: >-
Keyring name. If unset, defaults to repo-name-keyring.
origin:
description: >-
Origin. If unset, defaults to repo-name.
suite:
description: >-
Suite. If unset, defaults to repo-name.
label:
description: >-
Label. If unset, defaults to repo-name.
codename:
description: >-
Codename. If unset, defaults to repo-name.
components:
description: >-
Components. If unset, defaults to main.
default: main
architectures:
description: >-
Architectures. If unset, defaults to amd64.
section:
description: >-
Section (Optional)
priority:
description: >-
Priority (Optional)
limit:
description: >-
How many package versions to keep.
If unset, defaults to 0 (unlimited).
signing-key:
description: >-
Private gpg key for signing.
Please use Secrets!
required: true
signing-key-passphrase:
description: >-
Passphrase for private gpg signing key.
Please use Secrets!
import-from-repo-url:
description: >-
Import existing packages from this repo url.
Workaround for immutable GH actions cache.
import-from-repo-regex:
description: >-
Regex to apply to imported packages, e.g. filter for `^.*arm64.*\.deb`.
import-from-repo-failure-allow:
description: >-
Do not fail on import errors (e.g. first run).
maintainer:
description: >-
Package maintainer for keyring package.
If unset, defaults to apt-repo-action@${GITHUB_REPOSITORY_OWNER}
homepage:
description: >-
Homepage for keyring package.
If unset, defaults to ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
override:
description: >-
Optional override file (see [man page](https://manpages.debian.org/unstable/reprepro/reprepro.1.en.html#OVERRIDE_FILES))
outputs:
dir:
description: >-
Directory which contains the APT repo.
value: ${{ steps.create-apt-repo.outputs.dir }}
keyring:
description: >-
Keyring name.
value: ${{ steps.create-apt-repo.outputs.keyring }}
runs:
using: composite
steps:
- name: Detect runner distribution codename
id: runner-codename
run: echo "codename=$(lsb_release -sc)" >> "${GITHUB_OUTPUT}"
shell: bash
- name: Setup reprepro debian repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb https://packaging.gitlab.io/reprepro-multiple-versions/${{ steps.runner-codename.outputs.codename }} ${{ steps.runner-codename.outputs.codename }} main
repo-name: reprepro-multiple-versions
keys-asc: https://packaging.gitlab.io/reprepro-multiple-versions/gpg.key
update: true
- name: Install reprepro
uses: awalsh128/[email protected]
with:
packages: apt-mirror apt-transport-https reprepro
- name: Install nfpm
uses: robinraju/[email protected]
with:
repository: goreleaser/nfpm
fileName: '*Linux_x86_64.tar.gz'
latest: true
extract: true
out-file-path: "/tmp/"
- name: Import from APT repo
id: import-from-apt-repo
run: ${{ github.action_path }}/import.sh
shell: bash
env:
IMPORT_FROM_REPO: ${{ inputs.import-from-repo-url }}
IMPORT_FROM_REPO_REGEX: ${{ inputs.import-from-repo-regex }}
IMPORT_FROM_REPO_FAILURE_ALLOW: ${{ inputs.import-from-repo-failure-allow }}
- name: Create APT repo
id: create-apt-repo
run: ${GITHUB_ACTION_PATH}/repo.sh
shell: bash
env:
REPO_NAME: ${{ inputs.repo-name }}
SCAN_DIR: ${{ inputs.scan-dir }}
KEYRING_NAME: ${{ inputs.keyring-name }}
ORIGIN: ${{ inputs.origin }}
SUITE: ${{ inputs.suite }}
LABEL: ${{ inputs.label }}
CODENAME: ${{ inputs.codename }}
COMPONENTS: ${{ inputs.components }}
ARCHITECTURES: ${{ inputs.architectures }}
LIMIT: ${{ inputs.limit }}
SIGNING_KEY: ${{ inputs.signing-key }}
SIGNING_KEY_PASSPHRASE: ${{ inputs.signing-key-passphrase }}
MAINTAINER: ${{ inputs.maintainer }}
HOMEPAGE: ${{ inputs.homepage }}
OVERRIDE: ${{ inputs.override }}