build #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
schedule: | |
- cron: '0 12 1 * *' | |
workflow_dispatch: | |
jobs: | |
wheel: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
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 changelog was bundled properly | |
tar --list -f ./dist/*.tar.gz | grep "deareis/gui/changelog/CHANGELOG\.md" | |
# Check if the package license was included | |
tar --list -f ./dist/*.tar.gz | grep "LICENSE$" | |
# Check if the other licenses were bundled properly | |
tar --list -f ./dist/*.tar.gz | grep "deareis/gui/licenses/LICENSE-DearEIS.txt" | |
dist="$(tar --list -f ./dist/*.tar.gz | grep "deareis/gui/licenses/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')))); dist.remove('LICENSE-DearEIS.txt'); repo = set(list(map(basename, argv[2].split('\n')))); assert dist == repo, 'Incorrect set of bundled licenses! An extra .txt file has probably been left in the \'/src/deareis/gui/licenses\' folder.'; list(map(print, sorted(dist)))" "$dist" "$repo" | |
- name: Check wheel contents | |
run: | | |
# Check if the changelog was bundled properly | |
unzip -Z1 ./dist/*.whl | grep "deareis/gui/changelog/CHANGELOG\.md" | |
# Check if the package license was included | |
unzip -Z1 ./dist/*.whl | grep "LICENSE$" | |
# Check if the other licenses were bundled properly | |
unzip -Z1 ./dist/*.whl | grep "deareis/gui/licenses/LICENSE-DearEIS.txt" | |
dist="$(unzip -Z1 ./dist/*.whl | grep "deareis/gui/licenses/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')))); dist.remove('LICENSE-DearEIS.txt'); repo = set(list(map(basename, argv[2].split('\n')))); assert dist == repo, 'Incorrect set of bundled licenses! An extra .txt file has probably been left in the \'/src/deareis/gui/licenses\' folder.'; list(map(print, sorted(dist)))" "$dist" "$repo" | |
- name: Install wheel | |
working-directory: ./dist | |
run: python -m pip install *.whl |