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
|
name: CI
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
|
env:
|
||||||
|
# useful for scripts & sometimes tests to know
|
||||||
|
CI: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -10,8 +14,6 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: [3.6, 3.7, 3.8]
|
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:
|
steps:
|
||||||
# fuck me. https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
|
# fuck me. https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
|
||||||
|
@ -32,7 +34,7 @@ jobs:
|
||||||
|
|
||||||
pypi:
|
pypi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: [build] # add all other jobs here
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo "::add-path::$HOME/.local/bin"
|
- run: echo "::add-path::$HOME/.local/bin"
|
||||||
|
|
|
@ -5,6 +5,7 @@ from pathlib import Path
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
is_ci = os.environ.get('CI') is not None
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
import argparse
|
import argparse
|
||||||
|
@ -19,6 +20,10 @@ def main():
|
||||||
root = Path(__file__).absolute().parent.parent
|
root = Path(__file__).absolute().parent.parent
|
||||||
os.chdir(root) # just in case
|
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'
|
dist = root / 'dist'
|
||||||
if dist.exists():
|
if dist.exists():
|
||||||
shutil.rmtree(dist)
|
shutil.rmtree(dist)
|
||||||
|
|
Loading…
Add table
Reference in a new issue