-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for snap builds closes #19;
added snap build action workflow
- Loading branch information
1 parent
100a387
commit 94bf963
Showing
8 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,3 +242,5 @@ fabric.properties | |
# Custom rules | ||
.github | ||
docker | ||
snap | ||
*.snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: snap release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: build snap | ||
uses: snapcore/action-build@v1 | ||
|
||
- name: publish snap | ||
uses: snapcore/action-publish@v1 | ||
with: | ||
store_login: ${{ secrets.SNAP_LOGIN }} | ||
snap: ${{ steps.build.outputs.snap }} | ||
release: stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: snap unstable | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: build snap | ||
uses: snapcore/action-build@v1 | ||
|
||
- name: publish snap | ||
uses: snapcore/action-publish@v1 | ||
with: | ||
store_login: ${{ secrets.SNAP_LOGIN }} | ||
snap: ${{ steps.build.outputs.snap }} | ||
release: edge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,3 +265,4 @@ dmypy.json | |
# Custom rules | ||
test_certbot | ||
*.ini | ||
*.snap |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
requests>=2.20.0 | ||
zope.interface>=5.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh -e | ||
# This file is generated automatically and should not be edited manually. | ||
|
||
# get certbot version | ||
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then | ||
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog" | ||
exit 0 | ||
fi | ||
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) | ||
|
||
# get required certbot version for plugin. certbot version must be at least the plugin's | ||
# version. note that this is not the required version in setup.py, but the version number itself. | ||
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py) | ||
|
||
|
||
$SNAP/bin/python3 -c "import sys; from packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$? | ||
if [ "$exit_code" -eq 1 ]; then | ||
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" \ | ||
"this plugin can be updated; will try again on next refresh." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: certbot-dns-duckdns | ||
summary: DuckDNS Authenticator plugin for Certbot | ||
description: DuckDNS Authenticator plugin for Certbot | ||
confinement: strict | ||
grade: stable | ||
base: core20 | ||
adopt-info: certbot-dns-duckdns | ||
|
||
parts: | ||
certbot-dns-duckdns: | ||
plugin: python | ||
source: . | ||
override-pull: | | ||
snapcraftctl pull | ||
snapcraftctl set-version `grep ^__version__ $SNAPCRAFT_PART_SRC/certbot_dns_duckdns/__init__.py | cut -f2 -d= | tr -d "\"[:space:]\""` | ||
build-environment: | ||
- PIP_CONSTRAINT: $SNAPCRAFT_PART_SRC/snap-constraints.txt | ||
- SNAP_BUILD: "True" | ||
requirements: | ||
- snap-requirements.txt | ||
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 |