fix test pip deployments
This commit is contained in:
parent
4a83ff4864
commit
caabe4a3c8
2 changed files with 10 additions and 3 deletions
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
|
@ -3,6 +3,10 @@
|
|||
name: CI
|
||||
on: [push]
|
||||
|
||||
env:
|
||||
# useful for scripts & sometimes tests to know
|
||||
CI: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -10,8 +14,6 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8]
|
||||
# TODO shit. matrix is going to prevent from twine deployments because of version conflicts??
|
||||
# add 'and' clause??
|
||||
|
||||
steps:
|
||||
# fuck me. https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
|
||||
|
@ -32,7 +34,7 @@ jobs:
|
|||
|
||||
pypi:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
needs: [build] # add all other jobs here
|
||||
|
||||
steps:
|
||||
- run: echo "::add-path::$HOME/.local/bin"
|
||||
|
|
|
@ -5,6 +5,7 @@ from pathlib import Path
|
|||
from subprocess import check_call
|
||||
import shutil
|
||||
|
||||
is_ci = os.environ.get('CI') is not None
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
|
@ -19,6 +20,10 @@ def main():
|
|||
root = Path(__file__).absolute().parent.parent
|
||||
os.chdir(root) # just in case
|
||||
|
||||
if is_ci:
|
||||
# see https://github.com/actions/checkout/issues/217
|
||||
check_call('git fetch --prune --unshallow'.split())
|
||||
|
||||
dist = root / 'dist'
|
||||
if dist.exists():
|
||||
shutil.rmtree(dist)
|
||||
|
|
Loading…
Add table
Reference in a new issue