mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Build package
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
release:
|
|
types: [released, prereleased]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
jobs:
|
|
pip:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.8
|
|
|
|
- run: python -m pip install --upgrade pip setuptools_scm build twine
|
|
- name: Force version for Test PyPI upload
|
|
if: ${{ !startsWith(github.ref, 'refs/tags') }}
|
|
run: echo version=$(python -m setuptools_scm | awk -F+ '{print $1}' | tail -1) >> $GITHUB_ENV
|
|
|
|
- run: |
|
|
echo 'PKG = "pip"'>dvc/_build.py
|
|
python -m build
|
|
env:
|
|
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.version }}
|
|
- run: twine check --strict dist/*
|
|
|
|
- name: Publish to PyPI
|
|
if: github.event_name == 'release'
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|
|
- name: Publish to Test PyPI
|
|
if: ${{ github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
repository-url: https://test.pypi.org/legacy/
|
|
skip-existing: true
|