-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (94 loc) · 3.58 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI/CD Builds
on:
push:
branches:
- "**"
paths-ignore:
- docs/**.md
jobs:
python_build_and_test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version:
- 3.8
steps:
- name: Clone git repo
uses: actions/checkout@v1
- name: "Print Version Info (build number ${{ github.run_number }})"
run: |
echo "Build Number: $GITHUB_RUN_NUMBER"
echo "Version: $(cat VERSION).$GITHUB_RUN_NUMBER"
echo "Run ID: ${{ github.run_id }}"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pipx and poetry
run: |
python3 -m pip install pipx
python3 -m pipx ensurepath
pipx install poetry
- name: Install tap
run: |
poetry install
#- name: Run tests
# run: |
# poetry run pytest
pypi_publish:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version:
- 3.7
needs:
- python_build_and_test
steps:
- name: Clone git repo
uses: actions/checkout@v1
- name: Set up Python (v${{ matrix.python-version }})
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install pipx and poetry
run: |
python3 -m pip install pipx
python3 -m pipx ensurepath
pipx install poetry
- name: Push to PyPi (https://pypi.org/project/tap-powerbi-metadata/) (build number ${{ github.run_number }})
env:
BRANCH_NAME: ${{ github.ref }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_PUBLISH_TOKEN }}
run: |
echo "Publishing to PyPi..."
if [[ "$BRANCH_NAME" == *main ]]
then
poetry version --short
else
poetry version $(poetry version --short)-dev.$GITHUB_RUN_NUMBER
poetry version --short
fi
echo -e "\nPublishing to version ref '$(poetry version --short)'...\n\n"
poetry publish --build
- name: Wait up to 3 minutes for PyPi availability
run: |
pwd
ls -la
export VER=$(cat VERSION)
export PIPERR=$(pip install tapdance==$VER 2>&1)
echo "Checking for PyPi availability of version $VER"
if [[ $PIPERR == *"$VER"* ]]; then { echo "Yes"; } else { echo "Not yet found..."; sleep 30; } fi;
export PIPERR=$(pip install tapdance==$VER 2>&1)
if [[ $PIPERR == *"$VER"* ]]; then { echo "Yes"; } else { echo "Not yet found..."; sleep 30; } fi;
export PIPERR=$(pip install tapdance==$VER 2>&1)
if [[ $PIPERR == *"$VER"* ]]; then { echo "Yes"; } else { echo "Not yet found..."; sleep 30; } fi;
export PIPERR=$(pip install tapdance==$VER 2>&1)
if [[ $PIPERR == *"$VER"* ]]; then { echo "Yes"; } else { echo "Not yet found..."; sleep 30; } fi;
export PIPERR=$(pip install tapdance==$VER 2>&1)
if [[ $PIPERR == *"$VER"* ]]; then { echo "Yes"; } else { echo "Not yet found..."; sleep 30; } fi;
export PIPERR=$(pip install tapdance==$VER 2>&1)
if [[ $PIPERR == *"$VER"* ]]; then { echo "Yes"; } else { echo "Not yet found..."; sleep 30; } fi;
export PIPERR=$(pip install tapdance==$VER 2>&1)
if [[ $PIPERR == *"$VER"* ]]; then { echo "Yes"; } else { echo "Not found. Giving up. Last message from PyPi was $PIPERR"; exit 1; } fi;