-
Notifications
You must be signed in to change notification settings - Fork 534
60 lines (51 loc) · 1.93 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
code-quality:
uses: ./.github/workflows/code-quality.yaml
pypi-packaging:
name: Build and Publish llm-foundry PyPI Package
needs:
- code-quality
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Build source and wheel distributions
run: |
if [[ "${{ github.ref }}" =~ refs\/tags\/v ]]; then
PYPI_PACKAGE_NAME="llm-foundry"
else
PYPI_PACKAGE_NAME="llm-foundry-test-$(date +%Y%m%d%H%M%S)"
fi
# Remove the peft, xentropy-cuda-lib and triton-pre-mlir dependencies as PyPI does not
# support direct installs. The error message for importing PEFT, FusedCrossEntropy,
# and flash_attn_triton gives instructions on how to install if a user tries to use it
# without this dependency.
sed '/xentropy-cuda-lib@git+https:\/\/github.com\/HazyResearch\/flash-attention.git@.*/d' -i setup.py
sed '/triton-pre-mlir@git+https:\/\/github.com\/vchiley\/triton.git@.*/d' -i setup.py
sed '/peft@git+https:\/\/github.com\/huggingface\/peft.git.*/d' -i setup.py
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Publish 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: contains(github.ref, 'refs/tags/v')
with:
user: __token__
password: ${{ secrets.PROD_PYPI_API_TOKEN }}
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: contains(github.ref, 'refs/heads/') || contains(github.ref, 'refs/pull/')
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/