Skip to content

Commit ded9d78

Browse files
authoredApr 7, 2022
Update and rename test_and_deploy.yaml to CI.yaml
1 parent dd544dc commit ded9d78

File tree

2 files changed

+68
-42
lines changed

2 files changed

+68
-42
lines changed
 

‎.github/workflows/CI.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on: push
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.9
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install .[dev]
18+
- name: Lint
19+
run: |
20+
black ./ --check
21+
flake8
22+
# pre-commit install
23+
# pre-commit run --all
24+
check-tag:
25+
needs: [lint]
26+
runs-on: ubuntu-latest
27+
if: contains(github.ref, 'tags') && (!contains(github.ref_name, 'dev')) && (!contains(github.ref_name, 'rc'))
28+
steps:
29+
- run: echo "Tag '${{ github.ref_name }}' is valid."
30+
31+
release:
32+
needs: [check-tag]
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
- name: Create Release
38+
id: create_release
39+
uses: actions/create-release@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
42+
with:
43+
tag_name: ${{ github.ref_name }}
44+
release_name: "${{ github.ref_name }}"
45+
body: "🚀 Release: ${{ github.event.repository.name }} @ ${{ github.ref_name }}"
46+
draft: false
47+
prerelease: false
48+
49+
deploy:
50+
needs: [release]
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v2
54+
- name: Set up Python
55+
uses: actions/setup-python@v1
56+
with:
57+
python-version: "3.x"
58+
- name: Install dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install -U setuptools setuptools_scm wheel twine
62+
- name: Build and publish
63+
env:
64+
TWINE_USERNAME: __token__
65+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
66+
run: |
67+
python setup.py sdist bdist_wheel
68+
twine upload dist/* --verbose

‎.github/workflows/test_and_deploy.yaml

-42
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.