Skip to content

Commit 0a617e1

Browse files
authored
feat: add a testing snapcraft config to test commits instead of pulling version tags (#274)
1 parent 0fe8b0c commit 0a617e1

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ jobs:
139139
140140
build-snap:
141141
runs-on: ${{ matrix.os }}
142+
if: github.repository == 'tldr-pages/tldr-python-client' && github.ref == 'refs/heads/main'
142143
needs: ['build-linux']
143144

144145
strategy:
@@ -152,6 +153,7 @@ jobs:
152153
id: snapcraft-build
153154
with:
154155
snapcraft-args: "-v"
156+
path: "snap/test-snapcraft.yaml"
155157

156158
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
157159
with:

snap/test-snapcraft.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: tldr
2+
base: core24
3+
summary: tldr python client
4+
description: Python command-line client for tldr pages.
5+
6+
grade: stable
7+
confinement: strict
8+
9+
platforms:
10+
amd64:
11+
build-on: [amd64]
12+
build-for: [amd64]
13+
arm64:
14+
build-on: [arm64]
15+
build-for: [arm64]
16+
armhf:
17+
build-on: [armhf]
18+
build-for: [armhf]
19+
ppc64el:
20+
build-on: [ppc64el]
21+
build-for: [ppc64el]
22+
s390x:
23+
build-on: [s390x]
24+
build-for: [s390x]
25+
26+
parts:
27+
tldr:
28+
plugin: python
29+
source: https://github.com/tldr-pages/tldr-python-client.git
30+
source-type: git
31+
build-environment:
32+
- PATH: ${CRAFT_PART_INSTALL}/bin:${PATH}
33+
- PYTHONPATH: ${CRAFT_PART_INSTALL}/lib/python3.12/site-packages
34+
override-pull: |
35+
craftctl default
36+
sed -i "/data_files=\[('share\/man\/man1', \['docs\/man\/tldr\.1'\])\],/d" setup.py
37+
override-build: |
38+
craftctl default
39+
cd $CRAFT_PART_SRC/docs
40+
make man
41+
mkdir -p $CRAFT_PART_INSTALL/share/man/man1
42+
cp -r $CRAFT_PART_SRC/docs/man/tldr.1 $CRAFT_PART_INSTALL/share/man/man1/tldr.1
43+
python-packages:
44+
- Sphinx
45+
- sphinx-argparse
46+
prime:
47+
- -include
48+
- -bin/activate
49+
- -bin/activate.csh
50+
- -bin/activate.fish
51+
- -bin/Activate.ps1
52+
- -bin/python
53+
- -bin/python3
54+
- -bin/python3.12
55+
- -lib/*/*/sphinx*
56+
- -lib/*/*/setuptools*
57+
- -lib/*/*/pip*
58+
- -lib/*/*/pkg_resources
59+
- -bin/pip
60+
- -bin/pip3
61+
- -bin/pip3.12
62+
- -bin/[a-s, u-z, _]*
63+
- -pyvenv.cfg
64+
- -lib/*/*/[a-b, d-r, u-z, A-B, D-R, U-Z, _]*
65+
- -lib/*/*/certifi*
66+
- -lib/*/*/charset*
67+
- -lib/*/*/snowballs*
68+
69+
apps:
70+
tldr:
71+
command: bin/tldr
72+
environment:
73+
PYTHONPATH: $SNAP/lib/python3.12/site-packages:$PYTHONPATH
74+
plugs:
75+
- network
76+
- home

0 commit comments

Comments
 (0)