Skip to content

Commit

Permalink
Added make-release workflow conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
clyde-johnston committed Aug 9, 2023
1 parent 1f67440 commit e0de6f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: 'Build PyCyphal'
name: 'Release PyCyphal'
on:
push:
tags: [ '#release' ]
workflow_run:
workflows: [ 'Test PyCyphal' ]
branches: [ master ]
types: [ completed ]


# Ensures that only one workflow is running at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -17,7 +13,7 @@ jobs:
pycyphal-release:
name: Release PyCyphal
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ (github.ref == 'refs/heads/issue-259' || github.ref == 'refs/tags/#release') && github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out
uses: actions/checkout@v3
Expand All @@ -32,17 +28,23 @@ jobs:
run: |
cd pycyphal
echo "pycyphal_version=$(python -c 'from _version import __version__; print(__version__)')" >> $GITHUB_ENV
echo "*****"
echo $GHREF
env:
GHREF: ${{ github.ref }}

- name: Upload distribution
run: |
python -m twine upload dist/*
echo 'python -m twine upload dist/*'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_PYCYPHAL }}

- name: Push version tag
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.pycyphal_version }}
tag_prefix: ''
# - name: Push version tag
# uses: mathieudutour/github-tag-action@v6.1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# custom_tag: ${{ env.pycyphal_version }}
# tag_prefix: ''

# if: ${{ (github.ref == 'refs/head/issue-259' || github.ref == 'refs/tags/#release') && github.event.workflow_run.conclusion == 'success' }}
2 changes: 1 addition & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Run build and test
run: |
nox --non-interactive --error-on-missing-interpreters --session test pristine --python ${{ matrix.python }}
#nox --non-interactive --error-on-missing-interpreters --session test pristine --python ${{ matrix.python }}
nox --non-interactive --session demo check_style docs
- name: Save logs
Expand Down

0 comments on commit e0de6f3

Please sign in to comment.