-
Notifications
You must be signed in to change notification settings - Fork 34
47 lines (41 loc) · 1.5 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
name: Publish
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install Python dependencies
run: python -m pip install --upgrade pip wheel
- name: Build the packages
id: build
run: |
python setup.py sdist bdist_wheel
# Get the name of the .whl and .tar.gz files and set them as
# "outputs" of this step so we can upload them
echo "::set-output name=bdist_wheel::$(cd dist && ls *.whl)"
echo "::set-output name=sdist::$(cd dist && ls *.tar.gz)"
- name: Upload the wheel
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/${{ steps.build.outputs.bdist_wheel }}
asset_name: ${{ steps.build.outputs.bdist_wheel }}
asset_content_type: application/zip
- name: Upload the source distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/${{ steps.build.outputs.sdist }}
asset_name: ${{ steps.build.outputs.sdist }}
asset_content_type: application/gzip