-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (64 loc) · 2.12 KB
/
cd.yaml
File metadata and controls
76 lines (64 loc) · 2.12 KB
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
76
name: Continuous Deployment
on:
push:
tags: ["v*"]
defaults:
run:
shell: bash
jobs:
deploy:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
- name: Set up Python 3.11
uses: actions/setup-python@v5.1.0
with:
python-version: "3.11"
- id: cache-dependencies
name: Cache dependencies
uses: actions/cache@v4.0.2
with:
path: ${{ github.workspace }}/.venv
key: dependencies-${{ hashFiles('**/poetry.lock') }}
restore-keys: dependencies-
- name: Install dependencies
if: steps.cache-dependencies.cache-hit != 'true'
run: |
python -m pip install -U pip poetry
poetry check --no-interaction
poetry config virtualenvs.in-project true
poetry install --no-interaction
- name: Run tests
run: |
git config --global user.email "28790446+rodneyosodo@users.noreply.github.com"
git config --global user.name "Rodney Osodo"
poetry run coverage run --source=commitgpt -m pytest commitgpt/
- name: Coveralls
uses: coverallsapp/github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Add version to environment
run: |
PROJECT_VERSION=$(poetry version --short)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
- name: Build artifacts
run: |
poetry build --no-interaction
- name: Create Release Draft
uses: softprops/action-gh-release@v2
with:
body_path: "CHANGELOG.md"
draft: true
files: |
dist/commitgpt-${{env.PROJECT_VERSION}}-py3-none-any.whl
dist/commitgpt-${{env.PROJECT_VERSION}}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build --no-interaction