Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI tweak: use "release" event instead of "tag push" for pypi publishing #631

Merged
merged 4 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'