pi-top / debian-package-build-action Goto Github PK
View Code? Open in Web Editor NEWpi-top Docker-based Debian package builder
pi-top Docker-based Debian package builder
We need to move build-deb
and check-deb
logic into main.js
.
Example (https://github.com/casperdcl/deploy-pypi/blob/master/action.yml):
name: PyPI Deployment
author: Casper da Costa-Luis
description: Securely build and upload Python distributions to PyPI
inputs:
user:
description: PyPI username
required: false
default: __token__
password:
description: PyPI password or API token
required: true
requirements:
description: Build requirements
required: false
default: twine wheel
build:
description: '`setup.py` command to run ("true" is a shortcut for "clean sdist -d <dist_dir> bdist_wheel -d <dist_dir>")'
required: false
default: false
pip:
description: '`pip` command to run ("true" is a shortcut for "wheel -w <dist_dir> --no-deps .")'
required: false
default: false
check:
description: Whether to run basic checks on the built files
required: false
default: true
upload:
description: Whether to upload
required: false
default: true
dist_dir:
description: Directory containing distributions
required: false
default: dist
url:
description: Destination repository (package index) URL
required: false
default: ''
gpg_key:
description: GPG key to import for signing
required: false
default: ''
skip_existing:
description: Continue uploading files if one already exists
required: false
default: false
outputs:
whl:
description: Basename of *.whl for upload
value: ${{ steps.upload.outputs.whl }}
targz:
description: Basename of *.tar.gz for upload
value: ${{ steps.upload.outputs.targz }}
whl_asc:
description: Basename of *.whl.asc for upload (requires <gpg_key>)
value: ${{ steps.upload.outputs.whl_asc }}
targz_asc:
description: Basename of *.tar.gz.asc for upload (requires <gpg_key>)
value: ${{ steps.upload.outputs.targz_asc }}
runs:
using: composite
steps:
- name: build
run: |
if [[ -n "$INPUT_REQUIREMENTS" && "$INPUT_BUILD$INPUT_PIP" != falsefalse ]]; then
python -m pip install $INPUT_REQUIREMENTS
fi
if [[ "$INPUT_PIP" == wheel* ]]; then
python -m pip $INPUT_PIP
elif [[ "$INPUT_PIP" == true ]]; then
python -m pip wheel -w "$INPUT_DIST_DIR" --no-deps .
fi
if [[ "$INPUT_BUILD" == *build* || "$INPUT_BUILD" == *dist* || "$INPUT_BUILD" == *clean* ]]; then
python setup.py $INPUT_BUILD
elif [[ "$INPUT_BUILD" == true ]]; then
python setup.py sdist -d "$INPUT_DIST_DIR" bdist_wheel -d "$INPUT_DIST_DIR"
fi
shell: bash
env:
INPUT_REQUIREMENTS: ${{ inputs.requirements }}
INPUT_BUILD: ${{ inputs.build }}
INPUT_PIP: ${{ inputs.pip }}
INPUT_DIST_DIR: ${{ inputs.dist_dir }}
- name: check
run: |
if [[ "$INPUT_CHECK" == true ]]; then
python -m twine check "${INPUT_DIST_DIR%%/}"/*
fi
shell: bash
env:
INPUT_DIST_DIR: ${{ inputs.dist_dir }}
INPUT_CHECK: ${{ inputs.check }}
- id: upload
name: upload
run: |
DIST="${INPUT_DIST_DIR%%/}"
if [[ "$INPUT_UPLOAD" == true ]]; then
TWINE_OPTS=""
if [[ -n "$INPUT_GPG_KEY" ]]; then
gpg --import <(echo "$INPUT_GPG_KEY")
TWINE_OPTS="$TWINE_OPTS -s --sign-with gpg"
fi
if [[ "$INPUT_SKIP_EXISTING" == true ]]; then
TWINE_OPTS="$TWINE_OPTS --skip-existing"
fi
python -m twine upload $TWINE_OPTS "${DIST}"/*
fi
pushd "$DIST"
echo "::set-output name=whl::$(ls *.whl || :)"
echo "::set-output name=whl_asc::$(ls *.whl.asc || :)"
echo "::set-output name=targz::$(ls *.tar.gz || :)"
echo "::set-output name=targz_asc::$(ls *.tar.gz.asc || :)"
popd
shell: bash
env:
INPUT_UPLOAD: ${{ inputs.upload }}
INPUT_DIST_DIR: ${{ inputs.dist_dir }}
INPUT_GPG_KEY: ${{ inputs.gpg_key }}
INPUT_SKIP_EXISTING: ${{ inputs.skip_existing }}
TWINE_REPOSITORY_URL: ${{ inputs.url }}
TWINE_USERNAME: ${{ inputs.user }}
TWINE_PASSWORD: ${{ inputs.password }}
branding:
icon: upload-cloud
color: blue
Using the default settings:
- name: Build Debian package
uses: pi-top/debian-package-build-action@master
with:
target_architecture: amd64
docker_image: debian:stable
build_directory: artifacts
the build process is failing because debian:stable
doesn't contain sudo.
Installing dependencies
/usr/bin/docker exec deb-builder sudo apt-get update
OCI runtime exec failed: exec failed: unable to start container process: exec: "sudo": executable file not found in $PATH: unknown
Error: The process '/usr/bin/docker' failed with exit code 126
If entrypoint is overridden, it is not possible to git clone
without changing the curl lib version.
sudo apt reinstall -y --allow-downgrades libcurl3-gnutls/stable
This action will fail from 31st May 2023.
For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Currently, we copy all files in src to another directory to work on. This takes a long time if there are a lot of dependencies (such as with node_modules
directory).
We should look at if we want to remove it, symlink it, or something else that will enable this to be completed faster.
AFAICT, the pi-top repo is only needed for build dependencies that are not available for Debian or Raspberry Pi.
qtwebengine5-dev
is needed for web-renderer
and is not available on RPi OS, but IS available for ARM via Debian.
This means that we likely don't need to include ourselves as a source!
When Bullseye is released, we want to perform all package builds on the same distribution as their target. Currently we are ahead to benefit from improved syntax (thanks to debhelper-compat
).
However, lintian
can always be run on unstable
(i.e. latest releases) to benefit from the latest packaging information.
This can probably be run as a whalebrew image or similar, as it can easily run on its own.
E: Failed to fetch http://deb.debian.org/debian/pool/main/g/gtk%2b3.0/libgtk-3-common_3.24.30-2_all.deb 404 Not Found [IP: 151.101.210.132 80]
but it continues...
and there's no CMake:
https://github.com/pi-top/pi-topOS-Upstream-Package-Build/runs/3676896723?check_suite_focus=true
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.