Skip to content

Commit

Permalink
ci: split build and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardHd committed Jan 4, 2024
1 parent f5ac198 commit 534144c
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ name: CI-CD
on: [push]

jobs:
build_and_publish:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
environment:
name: pypi
url: https://pypi.org/p/data-factory-testing-framework
steps:
#----------------------------------------------
# check-out repo and set-up python
Expand Down Expand Up @@ -53,8 +48,30 @@ jobs:
run: |
poetry version 0.0.1.alpha${{ github.run_number}}
poetry build
#----------------------------------------------
# upload dist
#----------------------------------------------
- name: Upload dist
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
publish:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/data-factory-testing-framework
steps:
- name: Download dist
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish package distributions to PyPI
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist
packages-dir: ./dist

0 comments on commit 534144c

Please sign in to comment.