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

Update packaging and CI workflow #62

Merged
merged 5 commits into from
Sep 5, 2024
Merged
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
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
conda:
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
Expand All @@ -42,12 +46,12 @@ jobs:

steps:
- name: Get source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache conda packages
uses: actions/cache@v1
uses: actions/cache@v4
env:
# increment to reset cache
CACHE_NUMBER: 0
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.17.0

Expand All @@ -31,22 +31,22 @@ jobs:
CIBW_ARCHS: auto64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
deploy_pypi:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-20.04
needs: build_wheels
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
path: ./
- name: build pycbc for pypi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
name: Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
92 changes: 34 additions & 58 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
- main
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tarball:
name: Tarball
Expand All @@ -25,12 +29,12 @@ jobs:

steps:
- name: Get source code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand All @@ -40,7 +44,7 @@ jobs:
- name: Create distributions
run: python -m build --outdir . --sdist .

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: tarball
path: sbank-*.tar.*
Expand All @@ -56,14 +60,14 @@ jobs:
fail-fast: false
matrix:
debian:
- buster
- bookworm
runs-on: ubuntu-latest
container: igwn/base:${{ matrix.debian }}
env:
TARBALL: "sbank-*.tar.*"
steps:
- name: Download tarball
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: tarball

Expand Down Expand Up @@ -92,7 +96,7 @@ jobs:
# create debian source package files
dpkg-source --build src

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: dsc-${{ matrix.debian }}
path: |
Expand All @@ -109,14 +113,14 @@ jobs:
fail-fast: false
matrix:
debian:
- buster
- bookworm
runs-on: ubuntu-latest
container: igwn/base:${{ matrix.debian }}
env:
DSC: "sbank_*.dsc"
steps:
- name: Download source package
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: dsc-${{ matrix.debian }}

Expand Down Expand Up @@ -157,7 +161,7 @@ jobs:
dpkg --contents "${debf}"
done

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: deb-${{ matrix.debian }}
path: |
Expand All @@ -174,12 +178,12 @@ jobs:
fail-fast: false
matrix:
debian:
- buster
- bookworm
runs-on: ubuntu-latest
container: igwn/base:${{ matrix.debian }}
steps:
- name: Download binary packages
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deb-${{ matrix.debian }}

Expand All @@ -202,9 +206,9 @@ jobs:
- debian-binary
steps:
- name: Download debian package
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deb-buster
name: deb-bookworm

- name: Install lintian
run: |
Expand All @@ -226,21 +230,17 @@ jobs:
fail-fast: false
matrix:
el:
- el7-testing
- el8-testing
runs-on: ubuntu-latest
container: igwn/base:${{ matrix.el }}
env:
TARBALL: "sbank-*.tar.*"
steps:
- name: Download tarball
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: tarball

- name: Configure DNF
if: matrix.el == 'el7-testing'
run: ln -s /usr/bin/yum /usr/bin/dnf

- name: Configure EPEL
run: |
dnf -y install epel-release
Expand All @@ -249,14 +249,14 @@ jobs:
- name: Configure rpmbuild
run: |
dnf -y install \
python-srpm-macros \
"*-srpm-macros" \
rpm-build \
;

- name: Create source package
run: rpmbuild -ts --define "_srcrpmdir $(pwd)" ${TARBALL}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: srpm-${{ matrix.el }}
path: "*.src.rpm"
Expand All @@ -270,54 +270,35 @@ jobs:
fail-fast: false
matrix:
el:
- el7-testing
- el8-testing
runs-on: ubuntu-latest
container: igwn/base:${{ matrix.el }}
env:
SRPM: "python-sbank-*.src.rpm"
steps:
- name: Download SRPM
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: srpm-${{ matrix.el }}

- name: Configure DNF
if: matrix.el == 'el7-testing'
run: ln -s /usr/bin/yum /usr/bin/dnf

- name: Configure EPEL
run: |
dnf -y install epel-release
dnf -y install epel-rpm-macros

- name: Enable PowerTools (EL8+)
if: matrix.el != 'el7-testing'
- name: Enable PowerTools (EL8)
if: matrix.el == 'el8-testing'
run: |
dnf -y -q install "dnf-command(config-manager)"
dnf config-manager --set-enabled powertools

- name: Install build tools (EL7)
if: matrix.el == 'el7-testing'
run: |
dnf -y -q install \
rpm-build \
yum-utils \
;

- name: Install build tools (EL8+)
if: matrix.el != 'el7-testing'
- name: Install build tools
run: |
dnf -y -q install \
rpm-build \
"dnf-command(builddep)" \
;

- name: Install build dependencies (EL7)
if: matrix.el == 'el7-testing'
run: yum-builddep -y ${SRPM}

- name: Install build dependencies (EL8+)
if: matrix.el != 'el7-testing'
- name: Install build dependencies
run: dnf builddep -y ${SRPM}

- name: Build binary packages
Expand All @@ -340,7 +321,7 @@ jobs:
rpm -qp --requires "${rpmf}"
done

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: rpm-${{ matrix.el }}
path: "*.rpm"
Expand All @@ -354,42 +335,37 @@ jobs:
fail-fast: false
matrix:
el:
- el7-testing
- el8-testing
runs-on: ubuntu-latest
container: igwn/base:${{ matrix.el }}
steps:
- name: Download RPMs
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: rpm-${{ matrix.el }}

- name: Configure DNF
if: matrix.el == 'el7-testing'
run: ln -s /usr/bin/yum /usr/bin/dnf

- name: Configure EPEL
run: |
dnf -y install epel-release
dnf -y install epel-rpm-macros

- name: Install RPMs
run: dnf -y install *.rpm

lint-rhel:
name: Lint RPMs
runs-on: ubuntu-latest
container: centos:7
container: igwn/base:el8-testing
needs:
- rhel-binary
steps:
- name: Download RPM
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: rpm-el7-testing
name: rpm-el8-testing

- name: Install rpmlint
run: |
yum -y -q install \
dnf -y -q install \
rpmlint \
;

Expand Down
Loading
Loading