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

Fix Deployment Test Syntax bug #568

Merged
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
25 changes: 20 additions & 5 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ on:
pull_request:
branches: [master]

# Only allow the latest workflow to run and cancel all others. There is also job-level concurrency
# enabled (see below), which is specified slightly differently.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Build the python package even on PRs to ensure we're able to build the package properly.
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Set up Python
Expand All @@ -21,7 +28,7 @@ jobs:
- name: Install dependencies
run: python -m pip install --upgrade pip poetry

- name: Deploy to testpypi.org
- name: Building the wheels
run: |
# Need to check both Test PyPi and GH releases as we need to version bump the patch
# version everytime we merge in a PR, but once we release a new production release, we
Expand All @@ -48,8 +55,9 @@ jobs:
deploy:
runs-on: ubuntu-20.04
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -66,17 +74,24 @@ jobs:
dist/
key: cache-${{ github.run_id }}-${{ github.run_attempt }}

- name: Configure Poetry test repo
run: poetry config repositories.test_pypi https://test.pypi.org/legacy/

- name: Deploy to testpypi.org
run: |
poetry config repositories.test_pypi https://test.pypi.org/legacy/
poetry publish -r test_pypi --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true
if: github.ref == 'refs/heads/master'
run: poetry publish -r test_pypi --dist-dir dist/ --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true

- name: Deploy to testpypi.org (Dry Run)
if: github.ref != 'refs/heads/master'
run: poetry publish -r test_pypi --dist-dir dist/ --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true

update_release_draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
needs: deploy
if: github.ref == 'refs/heads/master'
steps:
- uses: release-drafter/release-drafter@v5
with:
Expand Down
Loading