[pre-commit.ci] pre-commit autoupdate #353
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: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
branches: | |
- main | |
paths-ignore: | |
- 'demo.py' | |
- 'demo_resources' | |
- '**.pyi' | |
- '.bumpversion.cfg' | |
- '.flake8' | |
- '.pre-commit-config.yaml' | |
- '**.md' | |
- '!README.md' | |
- '.github/**' | |
- '!.github/actions/setup-tox/**' | |
- '!.github/workflows/build.yml' | |
push: | |
branches: | |
- main | |
- release/** | |
tags-ignore: | |
- '*' | |
paths-ignore: | |
- 'demo.py' | |
- 'demo_resources' | |
- '**.pyi' | |
- '.bumpversion.cfg' | |
- '.flake8' | |
- '.pre-commit-config.yaml' | |
- '**.md' | |
- '!README.md' | |
- '.github/**' | |
- '!.github/actions/setup-tox/**' | |
- '!.github/workflows/build.yml' | |
workflow_dispatch: | |
inputs: | |
SOURCE_DATE_EPOCH: | |
description: 'SOURCE_DATE_EPOCH value for reproducible builds' | |
required: false | |
type: string | |
artifact-name: | |
description: 'Artifact name' | |
required: true | |
default: 'pydiamond-dist' | |
type: string | |
workflow_call: | |
inputs: | |
SOURCE_DATE_EPOCH: | |
description: 'SOURCE_DATE_EPOCH value for reproducible builds' | |
required: false | |
type: string | |
artifact-name: | |
description: 'Artifact name' | |
required: true | |
type: string | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
if: github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'Bump version:') | |
runs-on: ubuntu-20.04 | |
env: | |
SOURCE_DATE_EPOCH: ${{ inputs.SOURCE_DATE_EPOCH }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Setup tox | |
uses: ./.github/actions/setup-tox | |
- name: Check source distribution consistency | |
if: github.event_name != 'workflow_call' | |
run: tox run -e check-build-sdist | |
- name: Post-check cleanup | |
if: always() | |
run: rm -rf .tox/check-build-sdist | |
- name: Compute SOURCE_DATE_EPOCH from commit date | |
if: env.SOURCE_DATE_EPOCH == '' | |
run: | | |
date=$(git show ${{ github.sha }} --pretty="%ct" --no-patch) | |
echo "Using SOURCE_DATE_EPOCH=${date}" | |
echo "SOURCE_DATE_EPOCH=${date}" >> $GITHUB_ENV | |
- name: Build packages | |
run: tox run -e build | |
- name: Upload packages as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ inputs.artifact-name || 'pydiamond-dist' }} | |
path: dist |