Skip to content

Commit c408e99

Browse files
authored
Merge pull request #568 from PacificGilly/jamesgilmore/fix-deployment-test-syntax-bug
Fix Deployment Test Syntax bug
2 parents a59ce96 + ac19db3 commit c408e99

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/pre-release.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ on:
66
pull_request:
77
branches: [master]
88

9+
# Only allow the latest workflow to run and cancel all others. There is also job-level concurrency
10+
# enabled (see below), which is specified slightly differently.
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
915
jobs:
1016
# Build the python package even on PRs to ensure we're able to build the package properly.
1117
build:
1218
runs-on: ubuntu-20.04
19+
steps:
1320
- uses: actions/checkout@v4
1421

1522
- name: Set up Python
@@ -21,7 +28,7 @@ jobs:
2128
- name: Install dependencies
2229
run: python -m pip install --upgrade pip poetry
2330

24-
- name: Deploy to testpypi.org
31+
- name: Building the wheels
2532
run: |
2633
# Need to check both Test PyPi and GH releases as we need to version bump the patch
2734
# version everytime we merge in a PR, but once we release a new production release, we
@@ -48,8 +55,9 @@ jobs:
4855
deploy:
4956
runs-on: ubuntu-20.04
5057
needs: build
51-
if: github.ref == 'refs/heads/master'
5258
steps:
59+
- uses: actions/checkout@v4
60+
5361
- name: Set up Python
5462
uses: actions/setup-python@v5
5563
with:
@@ -66,17 +74,24 @@ jobs:
6674
dist/
6775
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
6876

77+
- name: Configure Poetry test repo
78+
run: poetry config repositories.test_pypi https://test.pypi.org/legacy/
79+
6980
- name: Deploy to testpypi.org
70-
run: |
71-
poetry config repositories.test_pypi https://test.pypi.org/legacy/
72-
poetry publish -r test_pypi --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true
81+
if: github.ref == 'refs/heads/master'
82+
run: poetry publish -r test_pypi --dist-dir dist/ --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true
83+
84+
- name: Deploy to testpypi.org (Dry Run)
85+
if: github.ref != 'refs/heads/master'
86+
run: poetry publish -r test_pypi --dist-dir dist/ --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} || true
7387

7488
update_release_draft:
7589
permissions:
7690
contents: write
7791
pull-requests: read
7892
runs-on: ubuntu-latest
7993
needs: deploy
94+
if: github.ref == 'refs/heads/master'
8095
steps:
8196
- uses: release-drafter/release-drafter@v5
8297
with:

0 commit comments

Comments
 (0)