-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54bd8cc
commit 9248565
Showing
2 changed files
with
97 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: v1.0 | ||
name: Publish release | ||
agent: | ||
machine: | ||
type: e1-standard-2 | ||
os_image: ubuntu2004 | ||
global_job_config: | ||
prologue: | ||
commands: | ||
- sem-version python 3.8 | ||
- checkout | ||
- python -m pip install -U pip poetry | ||
blocks: | ||
- name: Create release | ||
run: | ||
when: "branch = 'main'" | ||
task: | ||
secrets: | ||
- name: semantic-release-credentials | ||
jobs: | ||
- name: Collect package details and create GitHub release | ||
commands: | ||
- RELEASE_VERSION=$(python -m poetry version -s) | ||
- 'RELEASE_NOTES_FILE="release-notes/${RELEASE_VERSION}.md"' | ||
- 'if [ ! -f "$RELEASE_NOTES_FILE" ]; then echo "The release notes file \"${RELEASE_NOTES_FILE}\" does not exist."; exit 1; fi' | ||
- 'if [[ $RELEASE_VERSION =~ \.[0-9]+(a|b|rc)[0-9] ]]; then PRERELEASE="--prerelease"; fi' | ||
- gh release create $RELEASE_VERSION --notes-file $RELEASE_NOTES_FILE $PRERELEASE |
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,70 @@ | ||
version: v1.0 | ||
name: Python checks and tests | ||
agent: | ||
machine: | ||
type: e1-standard-2 | ||
os_image: ubuntu2004 | ||
global_job_config: | ||
prologue: | ||
commands: | ||
- checkout | ||
blocks: | ||
- name: Code checks | ||
dependencies: [] | ||
task: | ||
prologue: | ||
commands: | ||
- sem-version python 3.8 | ||
- python -m pip install -U pip poetry tox tox-poetry | ||
jobs: | ||
- name: checks | ||
commands: | ||
- python -m tox -e checks | ||
- name: Unit tests | ||
dependencies: | ||
- Code checks | ||
task: | ||
prologue: | ||
commands: | ||
- sem-version python $PY_VERSION | ||
- python -m pip install -U pip poetry tox tox-poetry | ||
jobs: | ||
- name: tests | ||
matrix: | ||
- env_var: PY_VERSION | ||
values: | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
commands: | ||
- 'PY_ENV=py"${PY_VERSION//.}"' | ||
- python -m tox -e $PY_ENV | ||
epilogue: | ||
on_pass: | ||
commands: | ||
- 'test-results publish "test-reports/$PY_ENV-junit.xml"' | ||
- name: Publish release | ||
dependencies: ["Unit tests"] | ||
run: | ||
when: "tag =~ '^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?$'" | ||
task: | ||
secrets: | ||
- name: pypi-credentials | ||
prologue: | ||
commands: | ||
- sem-version python 3.8 | ||
- python -m pip install -U pip poetry | ||
jobs: | ||
- name: Build and upload Python package | ||
commands: | ||
- poetry build -f wheel | ||
- poetry publish -u b11c -p $PYPI_PASSWORD | ||
after_pipeline: | ||
task: | ||
jobs: | ||
- name: Publish Test Results | ||
commands: | ||
- test-results gen-pipeline-report | ||
promotions: | ||
- name: Create new release | ||
pipeline_file: create-release.yml |