Skip to content

Commit

Permalink
ci: support rc publication
Browse files Browse the repository at this point in the history
  • Loading branch information
erichulburd committed Feb 14, 2022
1 parent 66f3025 commit a3f798f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ cache:
- apt-get install -f -y nodejs
- npm i

.publish-pypi-public: &publish-pypi-public
- poetry config http-basic.pypi $PUBLIC_PYPI_USERNAME $PUBLIC_PYPI_PASSWORD
- poetry publish --build

Checks:
stage: test
script:
Expand Down Expand Up @@ -70,17 +66,28 @@ Test Unit (3.9):
extends: .unit-test
image: python:3.9

PyPi Publish Release:
.pypi-publish:
stage: deploy
script:
before_script:
- *install-dependencies
- *install-dephell
- *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.
- npx semantic-release
- npx semantic-release --debug
# This reads the tag chosen by semantic-release
- *publish-pypi-public
- poetry config http-basic.pypi $PUBLIC_PYPI_USERNAME $PUBLIC_PYPI_PASSWORD
- poetry publish --build

PyPi Publish Release Candidate:
extends: .pypi-publish
rules:
- if: '$CI_COMMIT_BRANCH == "rc"'
when: manual

PyPi Publish Release:
extends: .pypi-publish
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
when: on_success
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"],
"branches": ["main", {"name": "rc", "prerelease": true}],
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "eslint",
Expand Down

0 comments on commit a3f798f

Please sign in to comment.