From eb6c3c520d7c0214960218501b49da1c545c86b2 Mon Sep 17 00:00:00 2001 From: Ryan Northey Date: Fri, 7 Jan 2022 14:27:16 +0000 Subject: [PATCH] release: Improve publishing pipeline Signed-off-by: Ryan Northey --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1ffd85a7..5010f01e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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: @@ -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__