Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] release: Improve publishing pipeline #163

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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