Skip to content

Commit

Permalink
release: Improve publishing pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax committed Jan 7, 2022
1 parent bfad2aa commit eb6c3c5
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
test:
# we might want to restrict these to not run on a release branch...
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -82,6 +83,8 @@ jobs:

publish:
runs-on: ubuntu-latest
# this should be only on main, not sure about tags...
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- package
steps:
Expand All @@ -91,14 +94,35 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Find packages to publish
- name: Update VERSION files
run: |
echo "Updating VERSION files"
- name: Commit changes
run: |
echo "Committing changes"
- name: Create release branch
run: |
echo "Creating release branch"
release:
runs-on: ubuntu-latest
# this should be only on release branch
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v1
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Copy packages to publish
run: |
echo "PUBLISH_PACKAGES=true" >> $GITHUB_ENV
mkdir dist-out
find packages/ -maxdepth 1 -type f ! -path "*dev*" | xargs -I{} cp {} dist-out/
[ "$(ls -A dist-out)" ] || echo "PUBLISH_PACKAGES=false" >> $GITHUB_ENV
- name: Publish to PyPi
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && env.PUBLISH_PACKAGES == 'true'
if: env.PUBLISH_PACKAGES == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down

0 comments on commit eb6c3c5

Please sign in to comment.