Skip to content

Commit 52051d4

Browse files
committed
buid: fix package building
- Install deps using poetry. - Install correct python version on runner. - Build-Depend on pybuild-plugin-pyproject
1 parent 5e8affc commit 52051d4

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

.github/workflows/packaging.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
needs:
3737
- test
3838
steps:
39+
- name: Set up Python 3.12
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: 3.12
43+
3944
- name: Get cASO repo
4045
uses: actions/checkout@v3
4146
with:
@@ -49,11 +54,16 @@ jobs:
4954
- name: Build sdist file
5055
run: poetry build
5156

52-
- name: Upload sidst to be used for other jobs
57+
- name: Write release version
58+
run: |
59+
TAG=${{ github.ref_name }}
60+
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
61+
62+
- name: Upload sdist to be used for other jobs
5363
uses: actions/upload-artifact@v3
5464
with:
55-
path: dist/caso-${{ github.ref_name }}.tar.gz
56-
name: caso-${{ github.ref_name }}.tar.gz
65+
path: dist/caso-${{ env.VERSION }}.tar.gz
66+
name: caso-${{ env.VERSION }}.tar.gz
5767

5868
- name: Update source distribution artifacts to release
5969
if: github.event_name == 'release'
@@ -69,6 +79,11 @@ jobs:
6979
- test
7080
- build-sdist
7181
steps:
82+
- name: Set up Python 3.12
83+
uses: actions/setup-python@v5
84+
with:
85+
python-version: 3.12
86+
7287
- name: Get cASO repo
7388
uses: actions/checkout@v3
7489
with:
@@ -81,16 +96,25 @@ jobs:
8196
run: sudo apt-get install -y dpkg-dev debhelper devscripts lintian python3-pip tox dh-python python3-all python3-all-dev python3-pbr
8297

8398
- name: Install dependencies
84-
run: pip install -r requirements.txt
99+
run: |
100+
python -m pip install --upgrade pip
101+
python -m pip install tox tox-gh-actions
102+
python -m pip install poetry poetry poetry-plugin-export
103+
poetry install
104+
105+
- name: Write release version
106+
run: |
107+
TAG=${{ github.ref_name }}
108+
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
85109
86110
- name: Download sdist artifact
87111
uses: actions/download-artifact@v3
88112
with:
89-
name: caso-${{ github.ref_name }}.tar.gz
113+
name: caso-${{ env.VERSION }}.tar.gz
90114
path: dist
91115

92116
- name: Copy sdist to expected debian source file
93-
run: cp dist/caso-${{ github.ref_name }}.tar.gz ../caso-${{ github.ref_name }}.orig.tar.gz
117+
run: cp dist/caso-${{ env.VERSION }}.tar.gz ../caso-${{ env.VERSION }}.orig.tar.gz
94118

95119
- name: Now build package
96120
run: dpkg-buildpackage -b
@@ -115,16 +139,26 @@ jobs:
115139
- build-sdist
116140
- test
117141
steps:
142+
- name: Set up Python 3.12
143+
uses: actions/setup-python@v5
144+
with:
145+
python-version: 3.12
146+
118147
- name: Get cASO repo
119148
uses: actions/checkout@v3
120149
with:
121150
repository: IFCA/caso
122151
ref: ${{ github.ref_name }}
152+
153+
- name: Write release version
154+
run: |
155+
TAG=${{ github.ref_name }}
156+
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
123157
124158
- name: Download sdist artifact
125159
uses: actions/download-artifact@v3
126160
with:
127-
name: caso-${{ github.ref_name }}.tar.gz
161+
name: caso-${{ env.VERSION }}.tar.gz
128162
path: dist
129163

130164
- name: debug
@@ -134,7 +168,7 @@ jobs:
134168
id: rpm
135169
uses: alvarolopez/rpmbuild@rockylinux9
136170
with:
137-
source_file: dist/caso-${{ github.ref_name}}.tar.gz
171+
source_file: dist/caso-${{ env.VERSION }}.tar.gz
138172
spec_file: "packaging/redhat/caso.spec"
139173

140174
- name: Update RPM artifacts to release

packaging/debian/control

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Build-Depends:
77
debhelper (>= 7.0.50),
88
dh-python,
99
python3-all,
10-
python3-all-dev
10+
python3-all-dev,
11+
pybuild-plugin-pyproject
1112
Standards-Version: 3.9.3
1213
X-Python3-Version: >=3.5
1314

packaging/debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export PYBUILD_NAME=caso
77
dh $@ --with python3 --buildsystem=pybuild
88

99
override_dh_auto_test:
10-
tox -epep8,bandit
10+
tox -eflake8,bandit

0 commit comments

Comments
 (0)