Skip to content

Use trusted publishing #3

Use trusted publishing

Use trusted publishing #3

Workflow file for this run

name: Build sdist
on:
pull_request:
branches:
- 4.x
- 5.x
paths-ignore:
- '.github/workflows/build_wheels_*'
- '.github/workflows/release.yml'
workflow_call:
inputs:
rolling:
type: boolean
default: false
workflow_dispatch:
permissions:
contents: read
jobs:
Build_sdist:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: [3.8]
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
build_sdist: [1]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
REPO_DIR: .
PROJECT_SPEC: opencv-python
PLAT: x86_64
MB_PYTHON_VERSION: ${{ matrix.python-version }}
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
MB_ML_VER: 2014
NP_TEST_DEP: numpy==1.19.4
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CONFIG_PATH: travis_config.sh
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20260725@sha256:b31dbd9260993812b011eeea543fe3bad30cd1803dd54963ffd74bb4b7e31f38
USE_CCACHE: 1
UNICODE_WIDTH: 32
SDIST: ${{ matrix.build_sdist || 0 }}
ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }}
ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }}
steps:
- name: Cleanup
run: find . -mindepth 1 -delete
working-directory: ${{ github.workspace }}
- name: Setup environment
if: inputs.rolling == 'true' || github.event_name == 'workflow_dispatch'
run: |
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v7
with:
submodules: false
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform }}
- name: Build a package
run: |
set -e
# Build and package
set -x
python -m pip install --upgrade pip
python -m pip install scikit-build
python setup.py sdist --formats=gztar
set +x
# Install and run tests
set -x
echo "skipping tests because of sdist"
- name: saving artifacts
uses: actions/upload-artifact@v7
with:
name: build-${{ matrix.platform }}-sdist-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
path: dist/opencv*.tar.gz