-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (66 loc) · 2.08 KB
/
build.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build
on:
push:
tags:
- "v*.*.*"
jobs:
test:
uses: ./.github/workflows/pytest.yaml
static-type-check:
uses: ./.github/workflows/static-type-check.yaml
code-style-check:
uses: ./.github/workflows/code-style-check.yaml
deploy:
needs: [test, static-type-check, code-style-check]
runs-on: ubuntu-latest
env:
PRIVATE_REPO_USER: "hmasdev"
strategy:
matrix:
python-version: [3.10]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Check Version
run: |
# Check if the tag is the same as simple_typing_application.__version__
if [ "$(git describe --tags)" != "v$(python -c 'from simple_typing_application import __version__; print(__version__)')" ]; then
echo "Tag and __version__ are not the same"
exit 1
fi
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Publish tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: dist/*.tar.gz
asset_content_type: application/gzip
- name: Publish .whl
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: dist/*.whl
asset_content_type: application/zip