diff options
| author | Jordan Cook <jordan.cook@pioneer.com> | 2021-04-29 15:41:46 -0500 |
|---|---|---|
| committer | Jordan Cook <jordan.cook@pioneer.com> | 2021-04-29 15:41:46 -0500 |
| commit | ec6d2fb6bb082e95bbf452fafe7397d9bd99d9b2 (patch) | |
| tree | 81fe631451ce61e98f691f933ad7f3e20ced403b /.github | |
| parent | c70dfde93ab43326fca9093f226301e173ebd3ab (diff) | |
| download | requests-cache-pre-release.tar.gz | |
Build pre-releases from 'pre-release' branch, and set version suffix in CI configpre-release
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build.yml | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10f778d..9dfaba6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [master, dev] + branches: [master, dev, pre-release] tags: ['v*'] pull_request: branches: [master, dev] @@ -102,21 +102,26 @@ jobs: - name: Run cyclomatic complexity check run: radon cc --show-complexity --average --order SCORE requests_cache - # Deploy pre-release builds from dev branch, and stable builds on tags only + # Deploy pre-release builds from 'pre-release' branch, and stable builds on tags only release: needs: [test, analyze] - if: startsWith(github.ref, 'refs/tags/v') || endsWith(github.ref, '/dev') + if: startsWith(github.ref, 'refs/tags/v') || endsWith(github.ref, '/pre-release') runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: ${{ env.LATEST_PY_VERSION }} + python-version: ${{ env.LATEST_PY_VERSION }} + - name: Set pre-release version number + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} + run: echo "PRE_RELEASE_SUFFIX=.dev${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV - name: Install dependencies run: pip install -U ".[build]" - name: Build wheel - run: python setup.py sdist bdist_wheel + run: | + python setup.py --version + python setup.py sdist bdist_wheel - name: Deploy to pypi env: TWINE_USERNAME: __token__ |
