Files
browser/.github/workflows/package-debian.yml
Thibaud-Vdb cca00c022e ci: pin github actions to commit shas
Mutable tags like @v6 can be re-pointed by whoever controls the action,
so the next run executes code nobody here reviewed, with the job's
token and secrets. Pinning to the full commit sha freezes what runs.
Version tags are kept as comments so renovate or dependabot can still
track updates.

dtolnay/rust-toolchain is pinned to a master commit with the toolchain
moved to an explicit input, as its readme recommends for sha pinning.
2026-07-20 14:56:59 +02:00

79 lines
2.2 KiB
YAML

name: package debian
on:
workflow_call:
permissions:
contents: write
env:
RELEASE: ${{ github.ref_type == 'tag' && github.ref_name || 'nightly' }}
jobs:
package:
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
deb_arch: amd64
- arch: aarch64
deb_arch: arm64
env:
ARCH: ${{ matrix.arch }}
DEB_ARCH: ${{ matrix.deb_arch }}
OS: linux
runs-on: ubuntu-22.04
container: debian:stable-slim
timeout-minutes: 10
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install packaging deps
run: |
apt-get update
apt-get install -y --no-install-recommends dpkg-dev
- name: Download linux binary
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: lightpanda-${{ env.ARCH }}-${{ env.OS }}
path: .
- name: Build Debian package
run: |
RAW_VERSION="${{ env.RELEASE }}"
PKGVER="${RAW_VERSION#v}"
echo "PKGVER=${PKGVER}" >> "$GITHUB_ENV"
ROOT="lightpanda_${PKGVER}_${DEB_ARCH}"
mkdir -p "$ROOT/DEBIAN" "$ROOT/usr/bin" "$ROOT/usr/share/doc/lightpanda"
install -m755 "lightpanda-${ARCH}-${OS}" "$ROOT/usr/bin/lightpanda"
install -m644 LICENSE "$ROOT/usr/share/doc/lightpanda/copyright"
cat > "$ROOT/DEBIAN/control" <<EOF
Package: lightpanda
Version: ${PKGVER}
Section: web
Priority: optional
Architecture: ${DEB_ARCH}
Depends: libc6 (>= 2.35)
Maintainer: Lightpanda <hello@lightpanda.io>
Homepage: https://lightpanda.io
Description: Lightpanda, headless browser built for AI and automation
EOF
dpkg-deb --build --root-owner-group "$ROOT"
- name: Upload Debian package to release
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
allowUpdates: true
artifacts: lightpanda_${{ env.PKGVER }}_${{ env.DEB_ARCH }}.deb
tag: ${{ env.RELEASE }}
makeLatest: true