Skip to content

build

build #50

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.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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