-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from MarinerQ/feature/pypi_publish
Add gitlab publish to pypi
- Loading branch information
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ stages: | |
|
||
include: | ||
- local: '/.gitlab/ci/check-semver.yaml' | ||
- local: '/.gitlab/ci/publish.yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.publish: | ||
stage: deploy | ||
image: python:3.10.2-bullseye | ||
|
||
# Change pip's cache directory to be inside the project directory since we can | ||
# only cache local items. | ||
variables: | ||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" | ||
|
||
# Pip's cache doesn't store the python packages | ||
# https://pip.pypa.io/en/stable/topics/caching/ | ||
# | ||
# If you want to also cache the installed packages, you have to install | ||
# them in a virtualenv and cache it as well. | ||
cache: | ||
paths: | ||
- .cache/pip | ||
- venv/ | ||
before_script: | ||
- python --version # For debugging | ||
- pip install virtualenv | ||
- virtualenv venv | ||
- source venv/bin/activate | ||
- python setup.py bdist_wheel | ||
# an alternative approach is to install and run: | ||
- pip install dist/* | ||
# run the command here | ||
- pip install build twine | ||
- python -m build | ||
artifacts: | ||
paths: | ||
- dist/*.whl | ||
|
||
gitlab-publish: | ||
extends: | ||
- .publish | ||
script: | ||
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* | ||
rules: | ||
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH == "dev") | ||
|
||
test-pypi-publish: | ||
extends: | ||
- .publish | ||
script: | ||
- TWINE_PASSWORD=${TEST_PYPI_TOKEN} TWINE_USERNAME=__token__ python -m twine upload --repository testpypi dist/* | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "dev" | ||
|
||
pypi-publish: | ||
extends: | ||
- .publish | ||
script: | ||
- TWINE_PASSWORD=${PYPI_TOKEN} TWINE_USERNAME=__token__ python -m twine upload dist/* | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
|
||
setup( | ||
name='sealgw', | ||
version="0.0.2", | ||
version="0.0.3", | ||
description='SealGW: SEmi-Analytical Localization for Gravitational Waves', | ||
author='Qian Hu', | ||
author_email='[email protected]', | ||
|