Skip to content

Commit

Permalink
wip: test PyPI Job behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
boromir674 committed Nov 13, 2023
1 parent 119b369 commit e43dcad
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ jobs:
matrix: ${{fromJSON(needs.set_github_outputs.outputs.matrix)}}
outputs:
SEMVER_PIP_FORMAT: ${{ steps.parse_version.outputs.SEMVER_PIP_FORMAT }}
ARTIFACTS: ${{ steps.set_artifacts_ref.outputs.ARTIFACTS }}
steps:
- run: echo "[INFO] Platform/OS ${{ matrix.platform }} , Python -> ${{ matrix.python-version }}"
- uses: actions/checkout@v3
Expand Down Expand Up @@ -330,10 +331,13 @@ jobs:
# if: ${{ matrix.platform == 'ubuntu-latest' || matrix.python-version != '3.6' }}
# run: tox -e docs --sitepackages -vv -s false

- run: echo ARTIFACTS="${{ env.DIST_DIR }}-${{ matrix.platform }}-${{ matrix.python-version }}" >> $GITHUB_OUTPUT
id: set_artifacts_ref

- name: Upload Source & Wheel distributions as Artefacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.DIST_DIR }}-${{ matrix.platform }}-${{ matrix.python-version }}
name: ${{ steps.set_artifacts_ref.outputs.ARTIFACTS }}
path: ${{ env.DIST_DIR }}
if-no-files-found: error

Expand Down Expand Up @@ -436,17 +440,29 @@ jobs:
### PYPI UPLOAD JOB ###
pypi_publ:
needs: [test_suite, check_which_git_branch_we_are_on]
if: startsWith(github.event.ref, 'refs/tags/v') && needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY
name: PyPI - Creds from Repo Environment
uses: boromir674/automated-workflows/.github/workflows/pypi_env.yml@test
with:
distro_name: "artificial_artwork"
distro_version: ${{ needs.test_suite.outputs.SEMVER_PIP_FORMAT }}
should_trigger: true
# does not affect the job, but is used to name the artifacts folder
artifacts_path: "downloaded-artifacts"
pypi_env: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }}
# optional
dist_folder: "dist"
distro_version: "${{ needs.test_suite.outputs.SEMVER_PIP_FORMAT }}"
should_trigger: ${{ startsWith(github.event.ref, 'refs/tags/v') && needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY }}
pypi_env: "${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }}"
artifacts_path: ${{ needs.test_suite.outputs.ARTIFACTS }}
secrets:
# This magically works, and the environment secret will be loaded
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

# if: startsWith(github.event.ref, 'refs/tags/v') && needs.check_which_git_branch_we_are_on.outputs.AUTOMATED_DEPLOY
# uses: boromir674/automated-workflows/.github/workflows/pypi_env.yml@test
# with:
# distro_name: "artificial_artwork"
# distro_version: ${{ needs.test_suite.outputs.SEMVER_PIP_FORMAT }}
# should_trigger: true
# # does not affect the job, but is used to name the artifacts folder
# artifacts_path: "downloaded-artifacts"
# pypi_env: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }}
# # optional
# dist_folder: "dist"

### PYPI UPLOAD JOB ###
# pypi_publish:
Expand Down
1 change: 0 additions & 1 deletion scripts/process_sem_ver.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@
# https://peps.python.org/pep-0440/#compatibility-with-other-version-schemes


# TODO use pep440 _regex (see top of cript)
parsed_versions_string = _regex.match(semver)

prerelease = parsed_versions_string.group("pre") or parsed_versions_string.group("dev") or ''
Expand Down

0 comments on commit e43dcad

Please sign in to comment.