Skip to content

build

build #74

Workflow file for this run

name: build
on:
schedule:
- cron: '0 12 1 * *'
workflow_dispatch:
jobs:
wheel:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Run pre-build script
run: |
python ./pre-build.py
- name: Build wheel
run: python -m build
- name: Check source distribution contents
run: |
# Check if the package license was included
tar --list -f ./dist/*.tar.gz | grep "LICENSE$"
# Check if the other licenses were included
dist="$(tar --list -f ./dist/*.tar.gz | grep "LICENSE-.*\.txt" | sort)"
repo="$(ls LICENSES | grep "LICENSE-.*.txt" | sort)"
python -c "from sys import argv; from os.path import basename; dist = set(list(map(basename, argv[1].split('\n')))); repo = set(list(map(basename, argv[2].split('\n')))); assert dist == repo, (dist, repo); list(map(print, sorted(dist)))" "$dist" "$repo"
- name: Check wheel contents
run: |
# Check if the package license was included
unzip -Z1 ./dist/*.whl | grep "LICENSE$"
# Check if the other licenses were included
dist="$(unzip -Z1 ./dist/*.whl | grep "LICENSE-.*\.txt" | sort)"
repo="$(ls LICENSES | grep "LICENSE-.*.txt" | sort)"
python -c "from sys import argv; from os.path import basename; dist = set(list(map(basename, argv[1].split('\n')))); repo = set(list(map(basename, argv[2].split('\n')))); assert dist == repo, (dist, repo); list(map(print, sorted(dist)))" "$dist" "$repo"
- name: Install wheel
working-directory: ./dist
run: python -m pip install *.whl