Skip to content

Commit

Permalink
Ci release tweaks (#50)
Browse files Browse the repository at this point in the history
* Switch to publishing on pypi only on release events to avoid accidentally publishing bad tag pushes

* sanity check the tag format

* TODO comments

* Bump version: 0.2.5 → 0.2.6
  • Loading branch information
bpkroth authored Jan 16, 2024
1 parent c8639c0 commit 2ebd3a5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.5
current_version = 0.2.6
commit = True
tag = True

Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ on:
default: false
required: false
push:
tags: ["v*"]
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [ published ]
merge_group:
types: [checks_requested]
schedule:
Expand Down Expand Up @@ -57,6 +58,10 @@ jobs:
echo "ERROR: tag ${{ github.ref_name }} doesn't appear to be included in the main branch." >&2
exit 1
fi
if ! echo "${{ github.ref_name }}" | egrep -q '^v([0-9]+\.){2,3}[0-9]+$'; then
echo "ERROR: tag ${{ github.ref_name }} doesn't appear to be a valid version tag." >&2
exit 1
fi
- name: Set NO_CACHE variable based on commit messages and for nightly builds
if: github.event_name == 'schedule' || contains(steps.get-commit-messages.outputs.COMMIT_MESSAGES, 'NO_CACHE=true') || github.event.inputs.NO_CACHE == 'true'
Expand Down Expand Up @@ -172,7 +177,7 @@ jobs:
rm -f doc/build/html/htmlcov/.gitignore
- name: Publish package to Test PyPi
if: github.ref_type == 'tag'
if: github.event == 'release' && github.ref_type == 'tag'
run: |
if [ -n "${{ secrets.PYPI_TEST_USERNAME }}" ]; then
docker exec --user vscode --env USER=vscode --env MAKEFLAGS=-Oline \
Expand All @@ -181,7 +186,7 @@ jobs:
fi
- name: Publish package to PyPi
if: github.repository == 'microsoft/mlos' && github.ref_type == 'tag'
if: github.repository == 'microsoft/mlos' && github.event == 'release' && github.ref_type == 'tag'
run: |
if [ -n "${{ secrets.PYPI_USERNAME }}" ]; then
docker exec --user vscode --env USER=vscode --env MAKEFLAGS=-Oline \
Expand Down Expand Up @@ -216,6 +221,7 @@ jobs:
# other resources used.
password: ${{ secrets.ACR_PASSWORD }}
- name: Publish the container images
# TODO: add cleanup step to remove old images
if: (github.repository == 'microsoft/mlos') && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
timeout-minutes: 15
run: |
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
author = 'GSL'

# The full version, including alpha/beta/rc tags
release = '0.2.5'
release = '0.2.6'

try:
from setuptools_scm import get_version
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"""

# NOTE: This should be managed by bumpversion.
_VERSION = '0.2.5'
_VERSION = '0.2.6'
2 changes: 1 addition & 1 deletion mlos_core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"""

# NOTE: This should be managed by bumpversion.
_VERSION = '0.2.5'
_VERSION = '0.2.6'

0 comments on commit 2ebd3a5

Please sign in to comment.