-
Notifications
You must be signed in to change notification settings - Fork 14
60 lines (50 loc) · 1.62 KB
/
release.yml
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:
release:
types:
- created
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PSWD }}
run: |
twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*
- name: Get version from cmdgpt/VERSION
id: get_version
run: |
VERSION=$(cat cmdgpt/VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Upload .tar.gz to GitHub release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/cmdgpt-${{ env.VERSION }}.tar.gz
asset_name: cmdgpt-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip
- name: Upload .whl to GitHub release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/cmdgpt-${{ env.VERSION }}-py3-none-any.whl
asset_name: cmdgpt-${{ env.VERSION }}-py3-none-any.whl
asset_content_type: application/zip