-
Notifications
You must be signed in to change notification settings - Fork 67
58 lines (54 loc) · 2.09 KB
/
deploy.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support documentation.
# This workflow will download a prebuilt Python version, install dependencies, build and deploy/publish a new release
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Deploy and Publish
on:
push:
branches:
- master
jobs:
deploy:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Deploy and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
- name: Test with pytest
run: |
pytest
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 18
- name: Install Semantic Release dependencies
run: |
sudo apt-get install bumpversion
npm install -g semantic-release
npm install -g @semantic-release/changelog
npm install -g @semantic-release/exec
npm install -g @semantic-release/git
npm install -g @semantic-release/github
npm install -g @semantic-release/commit-analyzer
npm install -g @semantic-release/release-notes-generator
npm install -g semantic-release-pypi
- name: Install setuptools
run: python -m pip install --upgrade setuptools wheel twine
- name: Publish to Git Releases and Tags
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}