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 547afab
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: 'Build PyCyphal'
name: 'Release PyCyphal Workflow'
on:
push:
tags: [ '#release' ]
workflow_run:
workflows: [ 'Test PyCyphal' ]
branches: [ master ]
types: [ completed ]

branch: [ master, issue-259 ]
tag: [ '#release' ]

# Ensures that only one workflow is running at a time
concurrency:
Expand All @@ -17,12 +13,19 @@ jobs:
pycyphal-release:
name: Release PyCyphal
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out
uses: actions/checkout@v3

- name: Install dependencies
- name: Wait for test job to complete
uses: lewagon/[email protected]
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
running-workflow-name: 'Release PyCyphal'

- name: Create distribution wheel
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip setuptools wheel twine
Expand All @@ -35,14 +38,15 @@ jobs:
- 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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.pycyphal_version }}
tag_prefix: ''
# - name: Push version tag
# uses: mathieudutour/[email protected]
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# custom_tag: ${{ env.pycyphal_version }}
# tag_prefix: ''

22 changes: 12 additions & 10 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
name: 'Test PyCyphal'
name: 'Test PyCyphal Workflow'
on: [ push, pull_request ]

# Test OpenCyphal PyCyphal release
on: push
# pull_request:
# branches:
# - master

# Ensures that only one workflow is running at a time
# Ensures that only one workflow is running at a time - required for duplicate pushes and repushing a PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
Expand All @@ -32,6 +27,13 @@ jobs:
- name: Log Python version
run: python --version

- name: Context variables
run: |
print ${{ github.workflow_sha }}
print ${{ github.workflow_ref }}
print ${{ github.workflow }}
print ${{ github.ref }}
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
Expand All @@ -54,7 +56,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 547afab

Please sign in to comment.