8000 gguf : add workflow for Pypi publishing (#2896) · ggml-org/llama.cpp@0d1c706 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d1c706

Browse files
authored
gguf : add workflow for Pypi publishing (#2896)
* gguf : add workflow for Pypi publishing * gguf : add workflow for Pypi publishing * fix trailing whitespace
1 parent 9509294 commit 0d1c706

File tree

2 files changed

+63
-3
lines changed

2 files changed

+63
-3
lines changed

.github/workflows/gguf-publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow will upload a Python Package using Twine when a GGUF release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# See `gguf-py/README.md` for how to make a release.
5+
6+
# This workflow uses actions that are not certified by GitHub.
7+
# They are provided by a third-party and are governed by
8+
# separate terms of service, privacy policy, and support
9+
# documentation.
10+
11+
name: Upload Python Package
12+
13+
on:
14+
workflow_dispatch:
15+
push:
16+
# Pattern matched against refs/tags
17+
tags:
18+
- 'gguf-v*' # Push events to every version tag
19+
20+
21+
jobs:
22+
deploy:
23+
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set up Python
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: '3.9.x'
32+
- name: Install dependencies
33+
run: |
34+
cd gguf-py
35+
python -m pip install poetry
36+
poetry install
37+
38+
- name: Build package
39+
run: poetry build
40+
- name: Publish package
41+
uses: pypa/gh-action-pypi-publish@release/v1
42+
with:
43+
password: ${{ secrets.PYPI_API_TOKEN }}

gguf-py/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,33 @@ In this case, upgrade Pip to the latest:
2727
pip install --upgrade pip
2828
```
2929

30-
## Publishing
31-
To publish the package, you need to have `twine` and `build` installed:
30+
## Automatic publishing with CI
31+
32+
There's a GitHub workflow to make a release automatically upon creation of tags in a specified format.
33+
34+
1. Bump the version in `pyproject.toml`.
35+
2. Create a tag named `gguf-vx.x.x` where `x.x.x` is the semantic version number.
36+
37+
```sh
38+
git tag -a gguf-v1.0.0 -m "Version 1.0 release"
39+
```
40+
41+
3. Push the tags.
42+
43+
```sh
44+
git push origin --tags
45+
```
46+
47+
## Manual publishing
48+
If you want to publish the package manually for any reason, you need to have `twine` and `build` installed:
3249

3350
```sh
3451
pip install build twine
3552
```
3653

3754
Then, folow these steps to release a new version:
3855

39-
1. Update the version in `pyproject.toml`.
56+
1. Bump the version in `pyproject.toml`.
4057
2. Build the package:
4158

4259
```sh

0 commit comments

Comments
 (0)
0