-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[Github][MLGO] Add workflow to release mlgo utils #78885
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-github-workflow @llvm/pr-subscribers-mlgo Author: Aiden Grossman (boomanaiden154) ChangesThis patch adds a workflow to publish the MLGO utilities to Pypi. Full diff: https://github.com/llvm/llvm-project/pull/78885.diff 3 Files Affected:
diff --git a/.github/workflows/publish-mlgo-utils.yml b/.github/workflows/publish-mlgo-utils.yml
new file mode 100644
index 000000000000000..43e0589c637a18f
--- /dev/null
+++ b/.github/workflows/publish-mlgo-utils.yml
@@ -0,0 +1,40 @@
+name: Release mlgo-utils
+
+permissions:
+ contents: read
+
+on:
+ workflow_dispatch:
+ inputs:
+ branch:
+ description: 'Branch'
+ required: true
+ type: string
+
+jobs:
+ release-mlgo-utils:
+ name: Release mlgo-utils
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout LLVM
+ uses: actions/[email protected]
+ with:
+ ref: "${{ inputs.branch }}"
+ - name: Install dependencies
+ run: |
+ pip3 install build==0.10.0 setuptools==68.0.00
+ - name: Package mlgo-utils
+ run: |
+ cd llvm/utils/mlgo-utils
+ python3 -m build
+ - name: Upload mlgo-utils to test.pypi.org
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ password: ${{ secrets.MLGO_UTILS_TEST_PYPI_API_TOKEN }}
+ repository-url: https://test.pypi.org/legacy/
+ packages-dir: llvm/utils/mlgo-utils/dist/
+ - name: Upload mlgo-utils to pypi.org
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ password: ${{ secrets.MLGO_UTILS_PYPI_API_TOKEN }}
+ packages-dir: llvm/utils/mlgo-utils/dist/
diff --git a/llvm/utils/mlgo-utils/mlgo/__init__.py b/llvm/utils/mlgo-utils/mlgo/__init__.py
index bcb5de2ff4d5752..917b6bc4c14b1cb 100644
--- a/llvm/utils/mlgo-utils/mlgo/__init__.py
+++ b/llvm/utils/mlgo-utils/mlgo/__init__.py
@@ -2,5 +2,11 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+from datetime import timezone, datetime
+
__versioninfo__ = (18, 0, 0)
-__version__ = ".".join(str(v) for v in __versioninfo__) + "dev"
+__version__ = (
+ ".".join(str(v) for v in __versioninfo__)
+ + "dev"
+ + datetime.now(tz=timezone.utc).strftime("%Y%m%d%H%M")
+)
diff --git a/llvm/utils/mlgo-utils/pyproject.toml b/llvm/utils/mlgo-utils/pyproject.toml
index be2af86cd05df30..abd243fd4fb4ee2 100644
--- a/llvm/utils/mlgo-utils/pyproject.toml
+++ b/llvm/utils/mlgo-utils/pyproject.toml
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
-name = "mlgo"
+name = "mlgo-utils"
description = "Tooling for ML in LLVM"
readme = "README.md"
requires-python = ">=3.8,<3.11"
|
@tstellar Once this gets approved, we'll need to add the secrets. I'm assuming we can't just reuse the lit secrets as they're probably repository specific. I also have the If that's not feasible, I can also just keep them on my account and send tokens over. |
We can create secrets at the organization level, but it still won't work until both lit and mlgo are under the llvm project account on pypi (lit is not under the llvm account yet).
Yes, you'll have to transfer the project. I need to look into how to do this. |
This patch adds a workflow to publish the MLGO utilities to Pypi.