Skip to content

Commit

Permalink
ci: use explicit branch to publish rc
Browse files Browse the repository at this point in the history
  • Loading branch information
erichulburd committed Feb 14, 2022
1 parent 13317f6 commit 637b3e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,31 @@ Test Unit (3.9):
.pypi-publish:
stage: deploy
before_script:
- *install-dependencies
- . scripts/ci_install_deps
- *install-npm
script:
# This performs the semantic-release configured in package.json.
# Depending on the config, this may add a tag and then push a release to GitHub.
# Depending on the config, this may add a tag and then publish a GitLab/GitHub release.
- npx semantic-release --debug
- poetry version -s >> version_tag
# This reads the tag chosen by semantic-release
- poetry config http-basic.pypi $PUBLIC_PYPI_USERNAME $PUBLIC_PYPI_PASSWORD
- poetry publish --build
artifacts:
paths:
- version_tag

# PUBLISH RC
# -------------------------------

PyPi Publish Release Candidate:
PyPI Publish (RC):
extends: .pypi-publish
rules:
- if: '$CI_COMMIT_BRANCH =~ /^rc\//'
when: manual

PyPi Publish Release:
PyPI Publish (Final):
extends: .pypi-publish
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
when: on_success
when: manual
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"semantic-release": "^17.1.1"
},
"release": {
"branches": ["main", {"name": "^rc\/.*", "prerelease": "rc"}],
"branches": ["main", {"name": "rc/update_qiskit_and_coupling_map_init", "channel": "rc", "prerelease": true}],
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "eslint",
Expand Down

0 comments on commit 637b3e6

Please sign in to comment.