Skip to content

Commit

Permalink
upload pypi after quay upload
Browse files Browse the repository at this point in the history
  • Loading branch information
matoval committed Dec 2, 2024
1 parent 037c78f commit c7fc360
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,6 @@ jobs:
- name: Checkout Receptor
uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5

- name: Install dependencies
run: |
python3 -m pip install twine build
- name: Set official pypi info
run: echo pypi_repo=pypi >> $GITHUB_ENV
if: ${{ github.repository_owner == 'ansible' }}

- name: Set unofficial pypi info
run: echo pypi_repo=testpypi >> $GITHUB_ENV
if: ${{ github.repository_owner != 'ansible' }}

- name: Set receptor pypi version
run: echo RECEPTORCTL_PYPI_VERSION=$(curl --silent https://pypi.org/pypi/receptorctl/json | jq --raw-output '"v" + .info.version') >> $GITHUB_ENV

- name: Build receptorctl and upload to pypi
if: ${{ env.RECEPTORCTL_PYPI_VERSION != env.TAG }}
run: |
make receptorctl_wheel receptorctl_sdist VERSION=$TAG
twine upload \
-r ${{ env.pypi_repo }} \
-u ${{ secrets.PYPI_USERNAME }} \
-p ${{ secrets.PYPI_PASSWORD }} \
receptorctl/dist/*
- name: Log in to GHCR
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
Expand Down Expand Up @@ -75,6 +47,34 @@ jobs:
src: ghcr.io/${{ github.repository }}:${{env.TAG}}
dst: quay.io/${{ github.repository }}:${{env.FLOATING_TAG}}

- name: Install python
uses: actions/setup-python@v5

- name: Install dependencies
run: |
python3 -m pip install twine build
- name: Set official pypi info
run: echo pypi_repo=pypi >> $GITHUB_ENV
if: ${{ github.repository_owner == 'ansible' }}

- name: Set unofficial pypi info
run: echo pypi_repo=testpypi >> $GITHUB_ENV
if: ${{ github.repository_owner != 'ansible' }}

- name: Set receptor pypi version
run: echo RECEPTORCTL_PYPI_VERSION=$(curl --silent https://pypi.org/pypi/receptorctl/json | jq --raw-output '"v" + .info.version') >> $GITHUB_ENV

- name: Build receptorctl and upload to pypi
if: ${{ env.RECEPTORCTL_PYPI_VERSION != env.TAG }}
run: |
make receptorctl_wheel receptorctl_sdist VERSION=$TAG
twine upload \
-r ${{ env.pypi_repo }} \
-u ${{ secrets.PYPI_USERNAME }} \
-p ${{ secrets.PYPI_PASSWORD }} \
receptorctl/dist/*
publish:
runs-on: ubuntu-latest
env:
Expand Down

0 comments on commit c7fc360

Please sign in to comment.