-
Notifications
You must be signed in to change notification settings - Fork 35
52 lines (43 loc) · 1.33 KB
/
source-package.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
name: Create source release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Get version tag
id: get_tag
run: |
[[ ! "$GITHUB_REF" =~ refs/tags ]] && exit
echo "::set-output name=value::${GITHUB_REF#refs/tags/v}"
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build source archive and wheel
shell: bash
run: |
pip install wheel
python setup.py sdist
python setup.py bdist_wheel
- name: Upload archive
uses: actions/upload-artifact@v2
with:
name: "heisenbridge-${{ steps.get_tag.outputs.value }}.tar.gz"
path: "dist/heisenbridge-${{ steps.get_tag.outputs.value }}.tar.gz"
- name: Upload tagged release
uses: softprops/action-gh-release@v1
with:
tag_name: "v${{ steps.get_tag.outputs.value }}"
files: |
dist/heisenbridge-${{ steps.get_tag.outputs.value }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}