From 9e7330a3e5bde39a87e0ac1b76c9e85db7a6d64a Mon Sep 17 00:00:00 2001 From: Nikolay Govorov Date: Wed, 19 Aug 2026 23:22:10 +0100 Subject: Add package task --- .github/workflows/ci.yml | 31 +++++++++ README.md | 19 ++++++ tasks/licenses | 6 +- tasks/package | 134 ++++++++++++++++++++++++++++++++++++++ tests/package | 124 +++++++++++++++++++++++++++++++++++ tests/package-integration | 42 ++++++++++++ 6 files changed, 352 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100755 tasks/package create mode 100755 tests/package create mode 100755 tests/package-integration diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..44a9e4c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: 2026 Nikolay Govorov +# SPDX-License-Identifier: 0BSD + +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + package: + name: Package task + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 + with: + version: 2026.7.5 + experimental: true + install: false + + - name: Check package contract + run: | + tests/package + tests/package-integration diff --git a/README.md b/README.md index 787b0b3..4635e04 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,25 @@ mise run licenses Consuming projects pin this repository by commit SHA. +## Packaging + +Projects build and stage their own binaries and keep their nFPM configuration. +The shared [`package`](tasks/package) task creates only the formats explicitly +requested by a project: nFPM packages (`deb`, `rpm`, or `apk`) and portable +archives (`tar.gz` or `zip`). Repository publication is intentionally outside +this task. + +```console +mise run package -- \ + --version VERSION --arch ARCH --output DIR \ + [--config nfpm.yaml] [--apk-public-key NAME.rsa.pub] \ + deb rpm apk + +mise run package -- \ + --archive-root DIR --archive-name NAME --output DIR \ + tar.gz zip +``` + ## Tool provisioning Each project declares its toolchain and standalone CLI dependencies in diff --git a/tasks/licenses b/tasks/licenses index cb8a932..5956052 100755 --- a/tasks/licenses +++ b/tasks/licenses @@ -1,15 +1,13 @@ -#!/bin/sh +#!/bin/sh -eu # SPDX-FileCopyrightText: 2026 Nikolay Govorov # SPDX-License-Identifier: 0BSD #MISE description="Verify repository licensing metadata" #MISE tools={"pipx:reuse"="6.2.0","aqua:EmbarkStudios/cargo-deny"="0.19.0"} -set -eu - check_copyright_headers() { invalid_headers=$( git grep -n -I -E \ - 'Copyright[[:space:]]+(\([cC]\)|©)|SPDX-FileCopyrightText:' \ + '^((