Skip to content

Commit d4aa932

Browse files
committed
Include packaging workflows and update jobs
Now we also force testing before releasing and building
1 parent d6604bf commit d4aa932

File tree

3 files changed

+111
-5
lines changed

3 files changed

+111
-5
lines changed

.github/workflows/packaging.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Create RPM and DEB packages on release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.7", "3.8", "3.9", "3.10"]
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tox tox-gh-actions
26+
27+
- name: Test with tox
28+
run: tox
29+
30+
build-deb:
31+
runs-on: ubuntu-latest
32+
needs: test
33+
steps:
34+
- name: Get cASO repo
35+
uses: actions/checkout@v3
36+
with:
37+
ref: ${{ github.ref_name }}
38+
39+
- name: Copy debian file into the correct place for the build
40+
run: cp -r packaging/debian debian
41+
42+
- name: Build Debian package
43+
uses: alvarolopez/action-debian-python-package@v3
44+
with:
45+
artifacts_directory: output
46+
os_distribution: stable
47+
48+
- name: Update DEB artifacts to release
49+
uses: AButler/[email protected]
50+
with:
51+
files: 'output/*deb'
52+
repo-token: ${{ secrets.GITHUB_TOKEN }}
53+
release-tag: ${{ github.ref_name }}
54+
55+
build-rpm:
56+
runs-on: ubuntu-latest
57+
needs: test
58+
steps:
59+
- name: Get cASO repo
60+
uses: actions/checkout@v3
61+
with:
62+
repository: IFCA/caso
63+
ref: ${{ github.ref_name }}
64+
65+
- name: Build sdist to use as source
66+
run: python setup.py sdist
67+
68+
- name: Build RPM package
69+
id: rpm
70+
uses: alvarolopez/rpmbuild@rockylinux8
71+
with:
72+
source_file: dist/caso-${{ github.ref_name}}.tar.gz
73+
spec_file: "packaging/redhat/caso.spec"
74+
75+
- name: Update RPM artifacts to release
76+
uses: AButler/[email protected]
77+
with:
78+
files: '${{ steps.rpm.outputs.rpm_dir_path }}/*/*rpm'
79+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/python-publish.yml

+27-3
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,44 @@ on:
88
types: [created]
99

1010
jobs:
11-
deploy:
12-
11+
test:
1312
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.7", "3.8", "3.9", "3.10"]
1416

1517
steps:
16-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install tox tox-gh-actions
29+
30+
- name: Test with tox
31+
run: tox
32+
33+
publish:
34+
runs-on: ubuntu-latest
35+
needs: test
36+
steps:
37+
- uses: actions/checkout@v3
38+
1739
- name: Set up Python
1840
uses: actions/setup-python@v2
1941
with:
2042
python-version: '3.x'
43+
2144
- name: Install dependencies
2245
run: |
2346
python -m pip install --upgrade pip
2447
pip install setuptools wheel twine
48+
2549
- name: Build and publish
2650
env:
2751
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

.github/workflows/python-test.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@ on:
55
- pull_request
66

77
jobs:
8-
build:
8+
test:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
1212
python-version: ["3.7", "3.8", "3.9", "3.10"]
1313

1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v2
16+
1617
- name: Set up Python ${{ matrix.python-version }}
1718
uses: actions/setup-python@v2
1819
with:
1920
python-version: ${{ matrix.python-version }}
21+
2022
- name: Install dependencies
2123
run: |
2224
python -m pip install --upgrade pip
2325
pip install tox tox-gh-actions
26+
2427
- name: Test with tox
2528
run: tox

0 commit comments

Comments
 (0)