From 4f723389baa1c078c4b640ae9c0b844c17d69065 Mon Sep 17 00:00:00 2001 From: Ben Hyman Date: Mon, 12 Jul 2021 19:17:31 -0400 Subject: [PATCH 1/7] Add Bower CI/CD dependency --- .github/workflows/python-publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index cecbcfdc..95fff451 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -25,8 +25,11 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.x' + - name: Set up npm + uses: bahmutov/npm-install@v1 - name: Install dependencies run: | + npm install -g bower python -m pip install --upgrade pip pip install build - name: Build package From c5427f8099010856e6adcb9ebeeb7046f4ab9cb7 Mon Sep 17 00:00:00 2001 From: Ben Hyman Date: Mon, 12 Jul 2021 21:59:07 -0400 Subject: [PATCH 2/7] Test on branch --- .github/workflows/python-publish.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 95fff451..9a7cf46e 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -11,8 +11,10 @@ name: Upload Python Package on: push: - tags: - - v[0-9]+.[0-9]+.[0-9]+ + branches: + - 'install-bower*' + # tags: + # - v[0-9]+.[0-9]+.[0-9]+ jobs: deploy: @@ -38,4 +40,5 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + password: bad_password + # password: ${{ secrets.PYPI_API_TOKEN }} From 6deee6ed80193c9305f5d738b4eeedff00db8c1b Mon Sep 17 00:00:00 2001 From: Ben Hyman Date: Mon, 12 Jul 2021 22:06:59 -0400 Subject: [PATCH 3/7] Use node --- .github/workflows/python-publish.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9a7cf46e..b82e63e4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -27,8 +27,18 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.x' - - name: Set up npm - uses: bahmutov/npm-install@v1 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + # - name: Set up npm + # uses: bahmutov/npm-install@v1 - name: Install dependencies run: | npm install -g bower From 4daf93503a3583ad152040e95f263ca99ca1e828 Mon Sep 17 00:00:00 2001 From: Ben Hyman Date: Mon, 12 Jul 2021 22:19:42 -0400 Subject: [PATCH 4/7] Install dependencies --- .github/workflows/python-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b82e63e4..369379ea 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -43,6 +43,7 @@ jobs: run: | npm install -g bower python -m pip install --upgrade pip + pip install -r requirements.txt pip install build - name: Build package run: python -m build From 994089b9b927e7617371d8f556c92b2e0b654afa Mon Sep 17 00:00:00 2001 From: Ben Hyman Date: Mon, 12 Jul 2021 22:29:02 -0400 Subject: [PATCH 5/7] Add cache --- .github/workflows/python-publish.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 369379ea..5be2ffba 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: '3.x' + python-version: '3.6' - name: Setup Node.js uses: actions/setup-node@v2 with: @@ -39,12 +39,23 @@ jobs: restore-keys: npm- # - name: Set up npm # uses: bahmutov/npm-install@v1 + - name: Set up cache + uses: actions/cache@v1 + id: cache + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install from requirements + if: steps.cache.outputs.cache-hit != 'true' + run: | + pip install -r requirements.txt + pip install build - name: Install dependencies run: | npm install -g bower python -m pip install --upgrade pip - pip install -r requirements.txt - pip install build - name: Build package run: python -m build - name: Publish package From 1f5a440b27604fe4aee92a7ad81a7526a1b17cd3 Mon Sep 17 00:00:00 2001 From: Ben Hyman Date: Mon, 12 Jul 2021 22:38:04 -0400 Subject: [PATCH 6/7] Add another mysql dep --- .github/workflows/python-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 5be2ffba..d6ba258c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -55,6 +55,7 @@ jobs: - name: Install dependencies run: | npm install -g bower + pip install mysql-python python -m pip install --upgrade pip - name: Build package run: python -m build From 80e0e580155da5c691f4182d416ece3edea54f46 Mon Sep 17 00:00:00 2001 From: Ben Hyman Date: Mon, 12 Jul 2021 22:45:21 -0400 Subject: [PATCH 7/7] Set up mysql --- .github/workflows/python-publish.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d6ba258c..5fac784c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -9,6 +9,11 @@ name: Upload Python Package +env: + DB_DATABASE: edge_dev + DB_USER: root + DB_PASSWORD: '' + on: push: branches: @@ -39,6 +44,10 @@ jobs: restore-keys: npm- # - name: Set up npm # uses: bahmutov/npm-install@v1 + - name: Set up MySQL + run: | + sudo /etc/init.d/mysql start + mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u root -p '' - name: Set up cache uses: actions/cache@v1 id: cache @@ -55,8 +64,8 @@ jobs: - name: Install dependencies run: | npm install -g bower - pip install mysql-python python -m pip install --upgrade pip + python -c 'import MySQLdb as Database; print(Database.__version__)' - name: Build package run: python -m build - name: Publish package