From d75c585504cbc242f613f467701539cb9d87a580 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 14:08:47 +0530 Subject: [PATCH 01/14] Add workflow --- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++++ .github/workflows/verify.yml | 33 ++++++++++++++++++++++ .travis.yml | 9 ------ setup.py | 1 + tox.ini | 8 ++---- 5 files changed, 88 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/verify.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ada0814 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +# This GitHub action can publish assets for release when a tag is created. +# Currently, it's setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). + +name: Release +on: + push: + tags: + - 'v*' + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: "3.9" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + chmod +x ./bootstrap.sh + ./bootstrap.sh + shell: bash + + - name: Run tests + run: tox -e check,py39 + shell: bash + + - name: Import GPG key + id: import_gpg + uses: hashicorp/ghaction-import-gpg@v2.1.0 + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + PASSPHRASE: ${{ secrets.PASSPHRASE }} + + - name: Publish to PyPI + run: | + chmod +x ./release.sh + ./release.sh -p $RELEASE_URL -k $KEY_ID + shell: bash + env: + KEY_ID: ${{ steps.import_gpg.outputs.fingerprint }} + RELEASE_URL: https://pypi.org/project/vinyldns-python/ + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + \ No newline at end of file diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..b6090bc --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,33 @@ +name: Verify + +on: + pull_request: + branches: [ '*' ] + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: "3.9" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + chmod +x ./bootstrap.sh + ./bootstrap.sh + shell: bash + + - name: Run tests + run: tox -e check,py39 + shell: bash \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2bf5f90..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: false -language: python -python: -- "2.7" -- "3.6" - -before_install: export BOTO_CONFIG=/dev/null -install: pip install tox-travis -script: tox diff --git a/setup.py b/setup.py index 232b056..be2797e 100644 --- a/setup.py +++ b/setup.py @@ -82,5 +82,6 @@ def run_tests(self): tests_require=[ 'responses==0.10.4', 'pytest==3.10.1', + 'tox>=3.24.5', ], ) diff --git a/tox.ini b/tox.ini index 09bcdff..4bcd8ca 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = clean, check, - {py27,py34,py35,py36,py37}, + {py27,py34,py35,py36,py37,py39}, report, func_test @@ -15,6 +15,7 @@ basepython = py35: {env:TOXPYTHON:python3.5} py36: {env:TOXPYTHON:python3.6} py37: {env:TOXPYTHON:python3.7} + py39: {env:TOXPYTHON:python3.9} {clean,check,report,codecov,func_test}: {env:TOXPYTHON:python3} setenv = PYTHONPATH={toxinidir}/tests @@ -70,8 +71,3 @@ commands = {posargs:pytest -vv func_tests} whitelist_externals = bash - -[travis] -python = - 2.7: check, py27 - 3.6: check, py36, func_test From c03e526483ba5af864a88c40195c0cf521218d82 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 14:23:19 +0530 Subject: [PATCH 02/14] Add func-test --- .github/workflows/release.yml | 2 +- .github/workflows/verify.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ada0814..0999994 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: shell: bash - name: Run tests - run: tox -e check,py39 + run: tox -e check,py39,func_test shell: bash - name: Import GPG key diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index b6090bc..31e2779 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -29,5 +29,5 @@ jobs: shell: bash - name: Run tests - run: tox -e check,py39 + run: tox -e check,py39,func_test shell: bash \ No newline at end of file From 87f03d12c0a44349b598b2409d14f818f92fdee2 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 15:25:49 +0530 Subject: [PATCH 03/14] Create release --- .github/workflows/release.yml | 40 +++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0999994..ff806b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + - id: get-version + run: echo "::set-output name=CURRENT_VERSION::$(cat setup.cfg | head -2 | tail -1 | awk -F= '{print $2}'| sed 's/ //g')" - name: Set up Python 3.9 uses: actions/setup-python@v2 @@ -33,20 +36,31 @@ jobs: shell: bash - name: Import GPG key - id: import_gpg - uses: hashicorp/ghaction-import-gpg@v2.1.0 - env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - PASSPHRASE: ${{ secrets.PASSPHRASE }} + id: import_gpg + uses: hashicorp/ghaction-import-gpg@v2.1.0 + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + PASSPHRASE: ${{ secrets.PASSPHRASE }} - name: Publish to PyPI - run: | - chmod +x ./release.sh - ./release.sh -p $RELEASE_URL -k $KEY_ID - shell: bash - env: - KEY_ID: ${{ steps.import_gpg.outputs.fingerprint }} - RELEASE_URL: https://pypi.org/project/vinyldns-python/ - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + chmod +x ./release.sh + ./release.sh -p $RELEASE_URL -k $KEY_ID + shell: bash + env: + KEY_ID: ${{ steps.import_gpg.outputs.fingerprint }} + RELEASE_URL: https://pypi.org/project/vinyldns-python/ + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Release + # Only create a release on push to the main branch + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + uses: softprops/action-gh-release@v0.1.13 + with: + name: Release v${{ steps.get-version.outputs.CURRENT_VERSION }} + tag_name: v${{ steps.get-version.outputs.CURRENT_VERSION }} + draft: true + prerelease: true + generate_release_notes: true \ No newline at end of file From a319fcad0c8cc052f3a42af72973701e7ea08cc0 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 15:34:43 +0530 Subject: [PATCH 04/14] Remove tags --- release.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/release.sh b/release.sh index 65bca76..7147639 100755 --- a/release.sh +++ b/release.sh @@ -86,12 +86,4 @@ do done echo "Uploading to pypi at ${RELEASE_URL}..." -twine upload ${RELEASE_URL} ${DIR}/dist/* - -if [ -z "${RELEASE_URL}" ]; then - echo "Pushing git tags..." - git push - git push --tags -else - echo "Skipping push to git!" -fi +twine upload ${RELEASE_URL} ${DIR}/dist/* \ No newline at end of file From 56827fccb1f344347e9707e5b1fd1a046c31075b Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 15:51:59 +0530 Subject: [PATCH 05/14] Push changes --- release.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 7147639..65436fb 100755 --- a/release.sh +++ b/release.sh @@ -86,4 +86,9 @@ do done echo "Uploading to pypi at ${RELEASE_URL}..." -twine upload ${RELEASE_URL} ${DIR}/dist/* \ No newline at end of file +twine upload ${RELEASE_URL} ${DIR}/dist/* + +if [ -z "${RELEASE_URL}" ]; then + echo "Pushing git tags..." + git push + git push --tags \ No newline at end of file From 16f2e55504509b0f2b50c4b6b73c301af5335951 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 16:26:39 +0530 Subject: [PATCH 06/14] Add changes --- .github/workflows/release.yml | 8 ++++---- release.sh | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff806b8..4f54fce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - - id: get-version - run: echo "::set-output name=CURRENT_VERSION::$(cat setup.cfg | head -2 | tail -1 | awk -F= '{print $2}'| sed 's/ //g')" - name: Set up Python 3.9 uses: actions/setup-python@v2 @@ -52,8 +49,11 @@ jobs: RELEASE_URL: https://pypi.org/project/vinyldns-python/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get current version + id: get-version + run: echo "::set-output name=CURRENT_VERSION::$(cat setup.cfg | head -2 | tail -1 | awk -F= '{print $2}'| sed 's/ //g')" + - name: Create Release - # Only create a release on push to the main branch if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} uses: softprops/action-gh-release@v0.1.13 with: diff --git a/release.sh b/release.sh index 65436fb..5cb5394 100755 --- a/release.sh +++ b/release.sh @@ -89,6 +89,5 @@ echo "Uploading to pypi at ${RELEASE_URL}..." twine upload ${RELEASE_URL} ${DIR}/dist/* if [ -z "${RELEASE_URL}" ]; then - echo "Pushing git tags..." - git push - git push --tags \ No newline at end of file + echo "Push to git" + git push \ No newline at end of file From dfc07c1f73e89da1191b4a8900f72484edc9c1c6 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 16:54:14 +0530 Subject: [PATCH 07/14] Change release task --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f54fce..51885fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,8 +59,6 @@ jobs: with: name: Release v${{ steps.get-version.outputs.CURRENT_VERSION }} tag_name: v${{ steps.get-version.outputs.CURRENT_VERSION }} - draft: true - prerelease: true generate_release_notes: true \ No newline at end of file From e0544d3bada7ffba97698f0ae1f5c5c49f8a3494 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 16:58:34 +0530 Subject: [PATCH 08/14] Change release task --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51885fb..1ae2729 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,6 @@ jobs: run: echo "::set-output name=CURRENT_VERSION::$(cat setup.cfg | head -2 | tail -1 | awk -F= '{print $2}'| sed 's/ //g')" - name: Create Release - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} uses: softprops/action-gh-release@v0.1.13 with: name: Release v${{ steps.get-version.outputs.CURRENT_VERSION }} From 15d5693bf65ed37853ad720acae2f5237be3d313 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Mon, 31 Jan 2022 17:40:30 +0530 Subject: [PATCH 09/14] Update verify --- .github/workflows/verify.yml | 5 ++++- setup.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 31e2779..35c8edc 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -24,10 +24,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install virtualenv chmod +x ./bootstrap.sh ./bootstrap.sh shell: bash - name: Run tests - run: tox -e check,py39,func_test + run: | + pip install tox docker-compose + tox -e check,py39,func_test shell: bash \ No newline at end of file diff --git a/setup.py b/setup.py index be2797e..232b056 100644 --- a/setup.py +++ b/setup.py @@ -82,6 +82,5 @@ def run_tests(self): tests_require=[ 'responses==0.10.4', 'pytest==3.10.1', - 'tox>=3.24.5', ], ) From c3900bc3a9332710284be4041dd9f23de81de4da Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Tue, 1 Feb 2022 18:23:11 +0530 Subject: [PATCH 10/14] Update workflows --- .github/workflows/release.yml | 41 +++++++++++++++-------------------- .github/workflows/verify.yml | 16 +++++--------- Makefile | 33 ++++++++++++++++++++++++++++ README.md | 13 ++++------- bootstrap.sh | 3 +++ tox.ini | 5 ++--- 6 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ae2729..662322d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,50 +14,45 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.4.0 - name: Set up Python 3.9 uses: actions/setup-python@v2 with: python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - chmod +x ./bootstrap.sh - ./bootstrap.sh + - name: Install Dependencies + uses: make install shell: bash - + - name: Run tests - run: tox -e check,py39,func_test + run: make test shell: bash - - name: Import GPG key - id: import_gpg - uses: hashicorp/ghaction-import-gpg@v2.1.0 - env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - PASSPHRASE: ${{ secrets.PASSPHRASE }} - - - name: Publish to PyPI - run: | - chmod +x ./release.sh - ./release.sh -p $RELEASE_URL -k $KEY_ID + - name: Build package + run: make build shell: bash - env: - KEY_ID: ${{ steps.import_gpg.outputs.fingerprint }} - RELEASE_URL: https://pypi.org/project/vinyldns-python/ - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} - name: Get current version + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') id: get-version run: echo "::set-output name=CURRENT_VERSION::$(cat setup.cfg | head -2 | tail -1 | awk -F= '{print $2}'| sed 's/ //g')" - name: Create Release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: softprops/action-gh-release@v0.1.13 with: name: Release v${{ steps.get-version.outputs.CURRENT_VERSION }} tag_name: v${{ steps.get-version.outputs.CURRENT_VERSION }} + draft: true + prerelease: true generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 35c8edc..85d03bd 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -8,29 +8,23 @@ on: workflow_dispatch: jobs: - build: + test: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.4.0 - name: Set up Python 3.9 uses: actions/setup-python@v2 with: python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install virtualenv - chmod +x ./bootstrap.sh - ./bootstrap.sh + - name: Install Dependencies + run: make install shell: bash - name: Run tests - run: | - pip install tox docker-compose - tox -e check,py39,func_test + run: make test shell: bash \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2dfc5db --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +SHELL=bash +RELEASE_URL=https://pypi.org/project/vinyldns-python + +# Check that the required version of make is being used +REQ_MAKE_VER:=3.82 +ifneq ($(REQ_MAKE_VER),$(firstword $(sort $(MAKE_VERSION) $(REQ_MAKE_VER)))) + $(error The version of MAKE $(REQ_MAKE_VER) or higher is required; you are running $(MAKE_VERSION)) +endif + +.ONESHELL: + +.PHONY: install +install: + @set -euo pipefail + echo "Updating pip" + python -m pip install --upgrade pip + echo "Installing dependencies" + pip install virtualenv + chmod +x bootstrap.sh + bash bootstrap.sh + +.PHONY: test +test: + @set -euo pipefail + echo "Running unit and functional tests" + tox -e check,py39,func_test + +.PHONY: build +build: + @set -euo pipefail + echo "Clearing the dist directory..." + rm -rf dist + python setup.py sdist bdist_wheel \ No newline at end of file diff --git a/README.md b/README.md index f3fed66..77d7e59 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ To run, `pip install vinyldns-python` and then: * `python3` * `pip` * `virtualenv` +* `docker` To get started, you will want to setup your virtual environment. @@ -43,25 +44,19 @@ To get started, you will want to setup your virtual environment. Unit tests are developed using [pytest](https://docs.pytest.org/en/latest/). We use [Responses](https://github.com/getsentry/responses), which allows for simple mocking of HTTP endpoints. -To run unit tests, you can simply run `python3 setup.py test`. To target a specific test, you can +To run unit tests, you can simply run `python3 setup.py test` from your virtualenv. To target a specific test, you can run `python3 setup.py test -a "-k my_test"` **Functional Tests** -Functional tests are also developed with pytest. These tests run against a local instance of VinylDNS. Note that for now -they are not tied into our travis build, so they must be run locally for validation. +Functional tests are also developed with pytest. These tests run against a local instance of VinylDNS. From your virtualenv, run `tox -e func_test` **Running a full build** When you are finished writing your code you will want to run everything including linters. The -simplest way to do this is to run `tox -e check,py36`, which will run static checks and run unit tests. - -If you see any failures / warnings, correct them until `tox` runs successfully. - -If you do not have `tox` in your environment, `pip install tox` to add it. For more information you can -read the [tox docs](https://tox.readthedocs.io/en/latest/index.html). +simplest way to do this is to run `tox -e check,py39,func_test` from virtualenv, which will run static checks and run unit tests, functional tests. ## Local Development See the [quickstart](https://github.com/vinyldns/vinyldns/blob/master/README.md#quickstart) in the diff --git a/bootstrap.sh b/bootstrap.sh index 56b9895..f7a29f7 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -7,3 +7,6 @@ python3 setup.py install echo "Installing twine..." pip install twine + +echo "Installing tox, docker-compose and wheel..." +pip install tox docker-compose wheel \ No newline at end of file diff --git a/tox.ini b/tox.ini index 4bcd8ca..7002595 100644 --- a/tox.ini +++ b/tox.ini @@ -4,17 +4,17 @@ envlist = clean, check, - {py27,py34,py35,py36,py37,py39}, + {py27,py35,py36,py37,py38,py39}, report, func_test [testenv] basepython = py27: {env:TOXPYTHON:python2.7} - py34: {env:TOXPYTHON:python3.4} py35: {env:TOXPYTHON:python3.5} py36: {env:TOXPYTHON:python3.6} py37: {env:TOXPYTHON:python3.7} + py38: {env:TOXPYTHON:python3.8} py39: {env:TOXPYTHON:python3.9} {clean,check,report,codecov,func_test}: {env:TOXPYTHON:python3} setenv = @@ -25,7 +25,6 @@ passenv = usedevelop = true deps = pytest - pytest-travis-fold pytest-cov responses python-dateutil From aa7ac8178ec74372195cf9441d5423c3b5e07303 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Tue, 1 Feb 2022 18:27:54 +0530 Subject: [PATCH 11/14] Update Makefile --- .github/workflows/release.yml | 4 +--- Makefile | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 662322d..5d8267f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,6 +53,4 @@ jobs: tag_name: v${{ steps.get-version.outputs.CURRENT_VERSION }} draft: true prerelease: true - generate_release_notes: true - - \ No newline at end of file + generate_release_notes: true \ No newline at end of file diff --git a/Makefile b/Makefile index 2dfc5db..d6677e4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ SHELL=bash -RELEASE_URL=https://pypi.org/project/vinyldns-python # Check that the required version of make is being used REQ_MAKE_VER:=3.82 From 5395a834d8030d71aa6f1964ae2b8c4ea97d3f81 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Tue, 1 Feb 2022 18:30:37 +0530 Subject: [PATCH 12/14] Resolve release.sh --- release.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index 5cb5394..a851abe 100755 --- a/release.sh +++ b/release.sh @@ -89,5 +89,9 @@ echo "Uploading to pypi at ${RELEASE_URL}..." twine upload ${RELEASE_URL} ${DIR}/dist/* if [ -z "${RELEASE_URL}" ]; then - echo "Push to git" - git push \ No newline at end of file + echo "Pushing git tags..." + git push + git push --tags +else + echo "Skipping push to git!" +fi \ No newline at end of file From 1485685c25b2173d117869ed56cb89c464891262 Mon Sep 17 00:00:00 2001 From: Aravindh-Raju Date: Thu, 3 Feb 2022 12:46:40 +0530 Subject: [PATCH 13/14] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d8267f..d5e396a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: python-version: "3.9" - name: Install Dependencies - uses: make install + run: make install shell: bash - name: Run tests From a294d33bd0a6617e7c8c9e2e3c860c58416ff3ac Mon Sep 17 00:00:00 2001 From: Aravindh R <61419792+Aravindh-Raju@users.noreply.github.com> Date: Tue, 1 Mar 2022 13:51:03 +0530 Subject: [PATCH 14/14] Create notify.yml to notify on slack --- .github/workflows/notify.yml | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/notify.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 0000000..2dbad5d --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,55 @@ +name: Notify on Workflow Complete + +on: + workflow_run: + workflows: [verify, release] + types: + - completed + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send Slack Notification On Success + uses: slackapi/slack-github-action@v1.18.0 + if: github.event.workflow_run.conclusion == 'success' + with: + # For posting a rich message using Block Kit + payload: | + { + "text": "[vinyldns-python] ${{ github.event.workflow.name }} workflow completed successfully!\nAction: ${{ github.event.workflow_run.html_url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":check_mark: [vinyldns-python] `${{ github.event.workflow.name }}` workflow completed successfully!\nAction: ${{ github.event.workflow_run.html_url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + + - name: Send Slack Notification on Failure + uses: slackapi/slack-github-action@v1.18.0 + if: github.event.workflow_run.conclusion != 'success' + with: + # For posting a rich message using Block Kit + payload: | + { + "text": "[vinyldns-python] ${{ github.event.workflow.name }} FAILED!\nAction: ${{ github.event.workflow_run.html_url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":x: [vinyldns-python] `${{ github.event.workflow.name }}` FAILED!\nAction: ${{ github.event.workflow_run.html_url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK