Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start adding support for snapcraft #7

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
with:
fetch-depth: 1
persist-credentials: false
- name: Shellcheck
- name: ShellCheck
uses: ludeeus/action-shellcheck@master

Docker:
needs: [Shellcheck]
needs: [ShellCheck]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -59,11 +59,30 @@ jobs:
${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:latest
Poetry:
needs: [Shellcheck]
needs: [ShellCheck]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.6
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
Snapcraft:
needs: [ShellCheck]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
repository: certbot/certbot
path: upstream
- uses: actions/setup-python@v2
with:
python-version: 3
cache: pip
- name: Install Snapcraft with LXD
uses: samuelmeuli/action-snapcraft@v2
- name: Build snap
run: sg lxd -c 'snapcraft --use-lxd'
52 changes: 52 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This file is generated automatically and should not be edited manually.
name: certbot-dns-godaddy
summary:
description:
confinement: strict
grade: stable
base: core20
adopt-info: certbot-dns-godaddy

parts:
certbot-dns-godaddy:
plugin: python
source: .
parse-info:
- pyproject.toml
build-environment:
# Constraints are passed through the environment variable PIP_CONSTRAINTS instead of using the
# parts.[part_name].constraints option available in snapcraft.yaml when the Python plugin is
# used. This is done to let these constraints be applied not only on the certbot package
# build, but also on any isolated build that pip could trigger when building wheels for
# dependencies. See https://github.com/certbot/certbot/pull/8443 for more info.
- PIP_CONSTRAINT: $SNAPCRAFT_PART_SRC/snap-constraints.txt
- SNAP_BUILD: "True"
# To build cryptography and cffi if needed
build-packages:
- gcc
- git
- build-essential
- libssl-dev
- libffi-dev
- python3-dev
- cargo
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared

slots:
certbot:
interface: content
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages

plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared