name: BTest on: pull_request: push: branches: [master] tags: - 'v*' - '!v*-dev' jobs: Run-BTest: strategy: matrix: python-version: - "3.10" - "3.11" - "3.12" - "3.13" os: [macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Set up git config # Set autocrlf mode to false so that actions/checkout doesn't # modify the line endings in all of the files (mostly in the # test Baselines) to be \r\n on Windows. run: | git config --global core.autocrlf false git config --global core.eol lf - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install btest - name: Install pysubnettree run: | python -m pip install --verbose -e . - run: | make test BTEST=$(which btest) upload: runs-on: ubuntu-latest needs: [Run-BTest] if: github.repository == 'zeek/pysubnettree' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') environment: name: pypi url: https://pypi.org/p/pysubnettree permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - uses: actions/checkout@v4 - name: Check release version # This fails e.g. if VERSION contains a dev commits suffix, # since we don't want to push these to PyPI. Accepts two- # and three-component version numbers (e.g. 1.0 and 1.0.1). run: | grep -E -x '[0-9]+\.[0-9]+(\.[0-9]+)?' VERSION - name: Build sdist run: | make dist - name: Upload to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }}