This repository has been archived by the owner on Feb 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (62 loc) · 2.1 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
61
62
63
64
name: release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Create release and upload artifacts
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2.0.1
with:
python-version: 3.8
- name: Install build tools
run: |
python -m pip install -U pip wheel
- name: Build packages
run: |
python setup.py sdist bdist_wheel
- name: Get wheel path
id: get-wheel-path
run: echo "::set-output name=wheel::$(ls dist/*.whl)"
- name: Get wheel file name
id: get-wheel-name
run: echo "::set-output name=wheel::$(basename $(ls dist/*.whl)|tail -n 1)"
- name: Get sdist path
id: get-sdist-path
run: echo "::set-output name=sdist::$(ls dist/*.tar.gz)"
- name: Get sdist file name
id: get-sdist-name
run: echo "::set-output name=sdist::$(basename $(ls dist/*.tar.gz)|tail -n 1)"
- name: Create release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload wheel
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.get-wheel-path.outputs.wheel }}
asset_name: ${{ steps.get-wheel-name.outputs.wheel }}
asset_content_type: application/x-wheel+zip
- name: Upload sdist
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.get-sdist-path.outputs.sdist }}
asset_name: ${{ steps.get-sdist-name.outputs.sdist }}
asset_content_type: application/x-tar