Skip to content

Commit 16392ce

Browse files
no-ticket: Add release workflow and cleanup readme (#6)
* Add release workflow and cleanup readme * Add mlflow to requirements * Update requirements.txt * Update .github/workflows/release.yml --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> update version in setup.py Update release workflow
1 parent 367cf32 commit 16392ce

4 files changed

Lines changed: 92 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Release on tag
2+
3+
on:
4+
push:
5+
# Trigger when a semver-like tag is pushed (e.g. v1.2.3)
6+
tags:
7+
- 'v*.*.*'
8+
9+
permissions:
10+
contents: write
11+
id-token: write
12+
13+
jobs:
14+
release:
15+
name: Build and Release
16+
runs-on: ubuntu-latest
17+
env:
18+
CLOUDSMITH_OWNER: ${{ secrets.CLOUDSMITH_OWNER }}
19+
CLOUDSMITH_REPOSITORY: ${{ secrets.CLOUDSMITH_REPOSITORY }}
20+
CLOUDSMITH_SERVICE_SLUG: ${{ secrets.CLOUDSMITH_SERVICE_SLUG }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
29+
- name: Install build tooling
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build wheel setuptools
33+
34+
- name: Verify version matches tag
35+
shell: bash
36+
run: |
37+
set -euo pipefail
38+
TAG_VERSION="${GITHUB_REF_NAME#v}"
39+
PKG_VERSION=$(python setup.py --version)
40+
echo "Package version: ${PKG_VERSION} | Tag version: ${TAG_VERSION}"
41+
test "${PKG_VERSION}" = "${TAG_VERSION}" || {
42+
echo "Version mismatch: setup.py (${PKG_VERSION}) != tag (${TAG_VERSION})"
43+
exit 1
44+
}
45+
46+
- name: Build package (sdist + wheel)
47+
run: |
48+
python -m build
49+
ls -la dist
50+
51+
- name: Create GitHub Release and upload assets
52+
uses: softprops/action-gh-release@v2
53+
with:
54+
tag_name: ${{ github.ref_name }}
55+
name: ${{ github.ref_name }}
56+
generate_release_notes: true
57+
files: |
58+
dist/*.whl
59+
dist/*.tar.gz
60+
61+
- name: Install and authenticate Cloudsmith CLI (OIDC)
62+
uses: cloudsmith-io/cloudsmith-cli-action@v1.0.3
63+
with:
64+
oidc-namespace: ${{ env.CLOUDSMITH_OWNER }}
65+
oidc-service-slug: ${{ env.CLOUDSMITH_SERVICE_SLUG }}
66+
67+
- name: Upload package to Cloudsmith
68+
env:
69+
OWNER: ${{ env.CLOUDSMITH_OWNER }}
70+
REPO: ${{ env.CLOUDSMITH_REPOSITORY }}
71+
run: |
72+
set -euo pipefail
73+
echo "Uploading to Cloudsmith: ${OWNER}/${REPO}"
74+
for file in dist/*.{tar.gz,whl}; do
75+
cloudsmith push python "${OWNER}/${REPO}" "$file"
76+
done
77+
78+
# - name: Publish to PyPI (Trusted Publishing)
79+
# uses: pypa/gh-action-pypi-publish@release/v1

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
[![Python 3.8–3.12](https://img.shields.io/badge/python-3.8%E2%80%933.12-blue.svg)](https://www.python.org/downloads/)
66
[![MLflow 2.x](https://img.shields.io/badge/MLflow-2.x-orange.svg)](https://mlflow.org/)
77

8-
A minimal **MLflow Artifact Repository plugin** that stores artifacts as **Cloudsmith RAW packages**.
8+
**MLflow Artifact Repository plugin** that stores artifacts as **Cloudsmith RAW packages**.
99

1010
---
1111

12-
## Highlights
12+
## Key Features
1313

1414
* Seamless MLflow integration (`cloudsmith://owner/repo`)
15-
* Preloads and lists artifacts with correct immediate-children semantics for the MLflow UI
15+
* List/Download artifacts within the MLflow UI
1616
* Organized via tags (`mlflow`, `experiment-<id>`, `run-<id>`, `path-<artifact_path>`)
1717

1818
---
@@ -140,9 +140,9 @@ pytest -q
140140

141141
```bash
142142
export CLOUDSMITH_RUN_INTEGRATION=1
143-
export CLOUDSMITH_API_KEY=... # required
144-
export CLOUDSMITH_TEST_OWNER=... # required
145-
export CLOUDSMITH_TEST_REPO=... # required
143+
export CLOUDSMITH_API_KEY="" # required
144+
export CLOUDSMITH_TEST_OWNER="" # required
145+
export CLOUDSMITH_TEST_REPO="" # required
146146

147147
pytest -q
148148
```
@@ -169,15 +169,15 @@ pytest -q
169169

170170
```bash
171171
# Dry-run: show packages for a run-id
172-
CLOUDSMITH_API_KEY=... CLOUDSMITH_OWNER=myorg CLOUDSMITH_REPO=myrepo \
172+
CLOUDSMITH_API_KEY="" CLOUDSMITH_OWNER=myorg CLOUDSMITH_REPO=myrepo \
173173
scripts/cleanup_orphans.sh --run-id 0123456789abcdef0123456789abcdef
174174

175175
# Delete for a run-id (confirmation required)
176-
CLOUDSMITH_API_KEY=... CLOUDSMITH_OWNER=myorg CLOUDSMITH_REPO=myrepo \
176+
CLOUDSMITH_API_KEY="" CLOUDSMITH_OWNER=myorg CLOUDSMITH_REPO=myrepo \
177177
scripts/cleanup_orphans.sh --run-id 0123456789abcdef0123456789abcdef --confirm
178178

179179
# Combine experiment-id + run-id
180-
CLOUDSMITH_API_KEY=... CLOUDSMITH_OWNER=myorg CLOUDSMITH_REPO=myrepo \
180+
CLOUDSMITH_API_KEY="" CLOUDSMITH_OWNER=myorg CLOUDSMITH_REPO=myrepo \
181181
scripts/cleanup_orphans.sh --experiment-id 123 --run-id 0123456789abcdef0123456789abcdef --confirm
182182
```
183183

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
mlflow>=2.0.0,<3.0.0
21
cloudsmith-api>=2.0.0
32
requests>=2.25.0
3+
mlflow>=2.12.0

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
setup(
1212
name="mlflow-cloudsmith-plugin",
13-
version="0.1.0",
14-
author="Bart Blizniak",
15-
author_email="bart@example.com",
13+
version="0.0.1",
14+
author="Cloudsmith CEng",
15+
author_email="support@cloudsmith.com",
1616
description="MLflow plugin for storing artifacts in Cloudsmith repositories",
1717
long_description=long_description,
1818
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)