From d9ba53e6e3856e41baecaa716a2541ae63b0b0bb Mon Sep 17 00:00:00 2001 From: Hirotaka Wakabayashi Date: Wed, 2 Dec 2020 12:56:29 +0900 Subject: [PATCH] Adds "schedule" and "release" trigger to CI workflow (#7) * Changes the target from "test-release" to "release" --- .github/workflows/python-package.yml | 14 ++++++++++++++ Makefile | 2 ++ python-k2hr3-osnl.spec | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9df6360..bf25c7e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -7,6 +7,13 @@ on: branches: [ master ] pull_request: branches: [ master ] + schedule: + - cron: '0 0 * * 1' + # Trigger the workflow on release, + # but only when published + release: + types: + - published jobs: build: @@ -45,3 +52,10 @@ jobs: - name: Install the package locally run: | make install + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + if: github.event_name == 'release' + run: | + make release diff --git a/Makefile b/Makefile index 1d39611..b4b6d28 100644 --- a/Makefile +++ b/Makefile @@ -123,6 +123,8 @@ test: version ## builds source and wheel package @echo 'rpmspec ' ${RPMSPEC_VERSION} @if test "${SOURCE_VERSION}" = "${HISTORY_VERSION}" -a "${HISTORY_VERSION}" = "${RPMSPEC_VERSION}" ; then \ pipenv run python3 -m unittest ; \ + else \ + exit 1; \ fi test-all: lint test diff --git a/python-k2hr3-osnl.spec b/python-k2hr3-osnl.spec index a83e8e0..2280032 100644 --- a/python-k2hr3-osnl.spec +++ b/python-k2hr3-osnl.spec @@ -1,7 +1,7 @@ %global srcname k2hr3_osnl %global pypi_name k2hr3-osnl Name: python-k2hr3-osnl -Version: 0.9.4 +Version: 0.9.5 Release: 1%{?dist} Summary: An OpenStack notification listener for K2HR3