mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-06 07:47:53 +10:00
- Add Homebrew formula (brew_dist/archivebox.rb) using virtualenv pattern
with auto-generation via homebrew-pypi-poet in bin/build_brew.sh
- Add Debian packaging via nFPM (pkg/debian/) with thin .deb that pip-installs
archivebox into /opt/archivebox/venv on postinstall
- Add build/release scripts: bin/{build,release}_{brew,deb}.sh
- Update CI workflows to build packages on release and test them
- Update README apt/brew install instructions with working commands
- Update bin/setup.sh to use .deb download instead of old Launchpad PPA
https://claude.ai/code/session_01Vx1EsNrNySgsc8Y67dGzCn
72 lines
2.1 KiB
YAML
72 lines
2.1 KiB
YAML
name: Build Homebrew formula
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Get version
|
|
id: version
|
|
run: echo "version=$(grep '^version = ' pyproject.toml | awk -F'\"' '{print $2}')" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Generate Homebrew formula
|
|
run: |
|
|
python3 -m venv /tmp/poet-venv
|
|
source /tmp/poet-venv/bin/activate
|
|
pip install --quiet "archivebox==${{ steps.version.outputs.version }}" homebrew-pypi-poet
|
|
poet -f archivebox > /tmp/archivebox-generated.rb
|
|
deactivate
|
|
|
|
- name: Upload formula artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: archivebox.rb
|
|
path: /tmp/archivebox-generated.rb
|
|
|
|
- name: Push to homebrew-archivebox tap
|
|
if: github.event_name == 'release'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
|
run: |
|
|
# Clone the tap repo and update the formula
|
|
git clone "https://x-access-token:${GH_TOKEN}@github.com/ArchiveBox/homebrew-archivebox.git" /tmp/tap
|
|
cp brew_dist/archivebox.rb /tmp/tap/archivebox.rb 2>/dev/null || cp /tmp/archivebox-generated.rb /tmp/tap/archivebox.rb
|
|
cd /tmp/tap
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add archivebox.rb
|
|
git diff --cached --quiet || git commit -m "Update archivebox to v${{ steps.version.outputs.version }}"
|
|
git push origin HEAD
|
|
|
|
test:
|
|
needs: build
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download formula artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: archivebox.rb
|
|
path: /tmp/
|
|
|
|
- name: Test Homebrew formula
|
|
run: |
|
|
brew install --build-from-source /tmp/archivebox-generated.rb || true
|
|
archivebox version
|