mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-11-22 03:18:04 +08:00
Six workflows had no permissions block and ran on whatever the repository default grants. They get contents: read at the workflow level. The three perf-fmt jobs pull ghcr.io/lightpanda-io/perf-fmt, a private image, with GITHUB_TOKEN, so they keep packages: read on top of it. No job in these workflows writes to the repository. actions/checkout leaves the job token in .git/config by default, where every later step and tool in the job can read it. Every checkout opts out except the three whose job pushes a branch with that token: the orderfile regen and the two nix dependency updates keep theirs. The Debian package build ran in debian:stable-slim, a tag that moves with every Debian point release. It is pinned to the current index digest, with the tag kept next to it for readability.
84 lines
2.5 KiB
YAML
84 lines
2.5 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
|
|
# Pinned by digest (the stable-slim index of 2026-10-19), so the
|
|
# package build runs the image that was reviewed, not whatever the
|
|
# tag points at next.
|
|
container: debian:stable-slim@sha256:eb593cf2c358cacef45ca0a424bbc7d30cfa3466265fc2662b9466a0ca6ba1c5
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- 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
|