Skip to content

Commit

Permalink
Fix Deployment Test Syntax bug
Browse files Browse the repository at this point in the history
I guess for this exact reason is why it will be useful to have this
`pre-release.yml` file being ran on PRs to validate nothing gets broken
before merging :)
  • Loading branch information
PacificGilly committed Apr 22, 2024
1 parent a59ce96 commit 2af7c65
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 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,10 +74,16 @@ 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:
Expand Down

0 comments on commit 2af7c65

Please sign in to comment.