Skip to content

Commit 71a0351

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> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 367cf32 commit 71a0351

4 files changed

Lines changed: 111 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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+
with:
25+
fetch-depth: 0
26+
27+
- name: Ensure the tag points to master
28+
shell: bash
29+
run: |
30+
set -euo pipefail
31+
echo "Tag ref: ${GITHUB_REF} (name: ${GITHUB_REF_NAME}), SHA: ${GITHUB_SHA}"
32+
# Fetch master to check ancestry
33+
git fetch --no-tags --prune --depth=1 origin master
34+
if git merge-base --is-ancestor "${GITHUB_SHA}" origin/master; then
35+
echo "Tag commit is an ancestor of origin/master. Proceeding."
36+
else
37+
if git merge-base --is-ancestor origin/master "${GITHUB_SHA}"; then
38+
echo "origin/master is an ancestor of tag commit. Proceeding."
39+
else
40+
echo "Error: The tag ${GITHUB_REF_NAME} does not point to a commit based on the latest master."
41+
exit 1
42+
fi
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: '3.11'
48+
49+
- name: Install build tooling
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install build wheel setuptools
53+
54+
- name: Verify version matches tag
55+
shell: bash
56+
run: |
57+
set -euo pipefail
58+
TAG_VERSION="${GITHUB_REF_NAME#v}"
59+
PKG_VERSION=$(python setup.py --version)
60+
echo "Package version: ${PKG_VERSION} | Tag version: ${TAG_VERSION}"
61+
test "${PKG_VERSION}" = "${TAG_VERSION}" || {
62+
echo "Version mismatch: setup.py (${PKG_VERSION}) != tag (${TAG_VERSION})"
63+
exit 1
64+
}
65+
66+
- name: Build package (sdist + wheel)
67+
run: |
68+
python -m build
69+
ls -la dist
70+
71+
- name: Create GitHub Release and upload assets
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
tag_name: ${{ github.ref_name }}
75+
name: ${{ github.ref_name }}
76+
generate_release_notes: true
77+
files: |
78+
dist/*.whl
79+
dist/*.tar.gz
80+
81+
- name: Install and authenticate Cloudsmith CLI (OIDC)
82+
uses: cloudsmith-io/cloudsmith-cli-action@v1.0.3
83+
with:
84+
oidc-namespace: ${{ env.CLOUDSMITH_OWNER }}
85+
oidc-service-slug: ${{ env.CLOUDSMITH_SERVICE_SLUG }}
86+
87+
- name: Upload package to Cloudsmith
88+
env:
89+
OWNER: ${{ env.CLOUDSMITH_OWNER }}
90+
REPO: ${{ env.CLOUDSMITH_REPOSITORY }}
91+
run: |
92+
set -euo pipefail
93+
echo "Uploading to Cloudsmith: ${OWNER}/${REPO}"
94+
for file in dist/*.{tar.gz,whl}; do
95+
cloudsmith push python "${OWNER}/${REPO}" "$file"
96+
done
97+
98+
# - name: Publish to PyPI (Trusted Publishing)
99+
# 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
setup(
1212
name="mlflow-cloudsmith-plugin",
1313
version="0.1.0",
14-
author="Bart Blizniak",
15-
author_email="bart@example.com",
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)