mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-10 13:22:09 -04:00
Merge pull request #2238 from lightpanda-io/deb-pkg
Release .deb package
This commit is contained in:
3 files changed
+162
-65
No files matched your search
@@ -0,0 +1,79 @@
|
||||
name: package archlinux
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
RELEASE: ${{ github.ref_type == 'tag' && github.ref_name || 'nightly' }}
|
||||
|
||||
jobs:
|
||||
package:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [x86_64, aarch64]
|
||||
|
||||
env:
|
||||
ARCH: ${{ matrix.arch }}
|
||||
OS: linux
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
container: archlinux:latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install packaging deps
|
||||
run: pacman -Syu --noconfirm --needed base-devel sudo
|
||||
|
||||
- name: Download linux binary
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: lightpanda-${{ env.ARCH }}-${{ env.OS }}
|
||||
path: .
|
||||
|
||||
- name: Build Arch package
|
||||
run: |
|
||||
useradd -m builder
|
||||
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
|
||||
RAW_VERSION="${{ env.RELEASE }}"
|
||||
PKGVER="${RAW_VERSION#v}"
|
||||
PKGREL="1"
|
||||
echo "PKGVER=${PKGVER}" >> "$GITHUB_ENV"
|
||||
echo "PKGREL=${PKGREL}" >> "$GITHUB_ENV"
|
||||
|
||||
mkdir -p pkg
|
||||
cp lightpanda-${{ env.ARCH }}-${{ env.OS }} pkg/
|
||||
cp LICENSE pkg/
|
||||
|
||||
cat > pkg/PKGBUILD <<EOF
|
||||
pkgname=lightpanda
|
||||
pkgver=${PKGVER}
|
||||
pkgrel=${PKGREL}
|
||||
pkgdesc="Lightpanda, headless browser built for AI and automation"
|
||||
arch=('x86_64' 'aarch64')
|
||||
url="https://lightpanda.io"
|
||||
license=('AGPL-3.0-or-later')
|
||||
options=(!strip !debug)
|
||||
package() {
|
||||
install -Dm755 "\$startdir/lightpanda-\$CARCH-linux" "\$pkgdir/usr/bin/lightpanda"
|
||||
install -Dm644 "\$startdir/LICENSE" "\$pkgdir/usr/share/licenses/\$pkgname/LICENSE"
|
||||
}
|
||||
EOF
|
||||
|
||||
chown -R builder:builder pkg
|
||||
cd pkg
|
||||
sudo -u builder env CARCH=${{ env.ARCH }} makepkg -f --noconfirm -A
|
||||
|
||||
- name: Upload Arch package to release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: pkg/lightpanda-${{ env.PKGVER }}-${{ env.PKGREL }}-${{ env.ARCH }}.pkg.tar.zst
|
||||
tag: ${{ env.RELEASE }}
|
||||
makeLatest: true
|
||||
@@ -0,0 +1,78 @@
|
||||
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@v6
|
||||
|
||||
- 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@v4
|
||||
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@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: lightpanda_${{ env.PKGVER }}_${{ env.DEB_ARCH }}.deb
|
||||
tag: ${{ env.RELEASE }}
|
||||
makeLatest: true
|
||||
@@ -134,70 +134,10 @@ jobs:
|
||||
|
||||
package-archlinux:
|
||||
if: github.ref_type == 'tag'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [x86_64, aarch64]
|
||||
|
||||
env:
|
||||
ARCH: ${{ matrix.arch }}
|
||||
OS: linux
|
||||
|
||||
needs: build-linux
|
||||
runs-on: ubuntu-22.04
|
||||
container: archlinux:latest
|
||||
timeout-minutes: 10
|
||||
uses: ./.github/workflows/package-archlinux.yml
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install packaging deps
|
||||
run: pacman -Syu --noconfirm --needed base-devel sudo
|
||||
|
||||
- name: Download linux binary
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: lightpanda-${{ env.ARCH }}-${{ env.OS }}
|
||||
path: .
|
||||
|
||||
- name: Build Arch package
|
||||
run: |
|
||||
useradd -m builder
|
||||
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
|
||||
RAW_VERSION="${{ env.RELEASE }}"
|
||||
PKGVER="${RAW_VERSION#v}"
|
||||
PKGREL="1"
|
||||
echo "PKGVER=${PKGVER}" >> "$GITHUB_ENV"
|
||||
echo "PKGREL=${PKGREL}" >> "$GITHUB_ENV"
|
||||
|
||||
mkdir -p pkg
|
||||
cp lightpanda-${{ env.ARCH }}-${{ env.OS }} pkg/
|
||||
cp LICENSE pkg/
|
||||
|
||||
cat > pkg/PKGBUILD <<EOF
|
||||
pkgname=lightpanda
|
||||
pkgver=${PKGVER}
|
||||
pkgrel=${PKGREL}
|
||||
pkgdesc="Lightpanda, headless browser built for AI and automation"
|
||||
arch=('x86_64' 'aarch64')
|
||||
url="https://lightpanda.io"
|
||||
license=('AGPL-3.0-or-later')
|
||||
options=(!strip !debug)
|
||||
package() {
|
||||
install -Dm755 "\$startdir/lightpanda-\$CARCH-linux" "\$pkgdir/usr/bin/lightpanda"
|
||||
install -Dm644 "\$startdir/LICENSE" "\$pkgdir/usr/share/licenses/\$pkgname/LICENSE"
|
||||
}
|
||||
EOF
|
||||
|
||||
chown -R builder:builder pkg
|
||||
cd pkg
|
||||
sudo -u builder env CARCH=${{ env.ARCH }} makepkg -f --noconfirm -A
|
||||
|
||||
- name: Upload Arch package to release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: pkg/lightpanda-${{ env.PKGVER }}-${{ env.PKGREL }}-${{ env.ARCH }}.pkg.tar.zst
|
||||
tag: ${{ env.RELEASE }}
|
||||
makeLatest: true
|
||||
package-debian:
|
||||
if: github.ref_type == 'tag'
|
||||
needs: build-linux
|
||||
uses: ./.github/workflows/package-debian.yml
|
||||
Reference in new issue
Block a user