Skip to content

Commit

Permalink
ci: release only after test is done
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Feb 22, 2021
1 parent f55b5f0 commit 48524ed
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 70 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,67 @@ jobs:
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true

# This cannot be a separate workflow yet, because a workflow cannot depend on another workflow. See this topic:
# Depend on another workflow - Code to Cloud / GitHub Actions - GitHub Support Community
# https://github.community/t/depend-on-another-workflow/16311
release:
needs: [build, coveralls_finish]
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#determining-when-to-use-contexts
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/semantic-release' # FIXME[AA]:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install dependencies
run: |
python --version
python3 --version
pip --version
python3 -m pip --version
# Upgrade pip/setuptools first, so the line below will use the upgraded versions
python3 -m pip install --upgrade pip setuptools
python3 -m pip install --upgrade poetry pre-commit bumpversion twine
pre-commit --version
twine --version
python3 -m pip freeze
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
# https://github.com/marketplace/actions/action-for-semantic-release#semantic_version
# https://github.com/semantic-release/semantic-release/releases
semantic_version: 17.3.9

# https://github.com/marketplace/actions/action-for-semantic-release#dry_run
dry_run: true # FIXME[AA]:

# https://github.com/marketplace/actions/action-for-semantic-release#branches
# Keeping all branches here, so it's easier to debug; just comment or change "pull_request.branches" above
branches: |
[
'.+'
]
# https://github.com/marketplace/actions/action-for-semantic-release#extra_plugins
# https://github.com/semantic-release/changelog/releases
# https://github.com/semantic-release/git/releases
# https://github.com/semantic-release/exec/releases
extra_plugins: |
@semantic-release/changelog@5.0.1
@semantic-release/git@9.0.0
@semantic-release/exec@5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_TEST_PASSWORD: ${{ secrets.TWINE_TEST_PASSWORD }}
- name: New release published
if: steps.semantic.outputs.new_release_published == 'true'
run: |
echo ${{ steps.semantic.outputs.new_release_version }}
echo ${{ steps.semantic.outputs.new_release_major_version }}
echo ${{ steps.semantic.outputs.new_release_minor_version }}
echo ${{ steps.semantic.outputs.new_release_patch_version }}
echo ${{ steps.semantic.outputs.new_release_channel }}
echo ${{ steps.semantic.outputs.new_release_notes }}
70 changes: 0 additions & 70 deletions .github/workflows/release.yaml

This file was deleted.

0 comments on commit 48524ed

Please sign in to comment.