Skip to content

Commit b611834

Browse files
feat: update CI workflows for improved release process and coverage reporting (#119)
1 parent f40adf0 commit b611834

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

.github/workflows/continous_deployment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: PYPi
33
on:
44
push:
55
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
6+
87

98
workflow_dispatch:
109
jobs:

.github/workflows/release.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,38 @@ jobs:
1010
release:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-python@v3
13+
- name: 📥 Checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
ref: ${{ github.event.release.target_commitish }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: 🐍 Setup Python
21+
uses: actions/setup-python@v3
1522
with:
1623
python-version: '3.9'
1724
architecture: x64
18-
- run: pip install poetry==1.3.1
19-
- run: poetry build
20-
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
25+
26+
- name: 📦 Install Poetry
27+
run: pip install poetry==1.3.1
28+
29+
- name: 🔧 Configure git
30+
run: |
31+
git config user.name "github-actions[bot]"
32+
git config user.email "github-actions[bot]@users.noreply.github.com"
33+
34+
- name: 🚀 Bump version, commit, and push
35+
run: |
36+
poetry version ${{ github.ref_name }}
37+
git add pyproject.toml
38+
git commit -m "chore(release): version ${{ github.ref_name }}"
39+
git tag -f ${{ github.ref_name }} HEAD
40+
git push origin ${{ github.event.release.target_commitish }}
41+
git push -f origin refs/tags/${{ github.ref_name }}
42+
43+
- name: 📦 Build package
44+
run: poetry build
45+
46+
- name: 🚀 Publish to PyPI
47+
run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: 📈 Upload coverage to Codecov
4747
uses: codecov/codecov-action@v2
48-
if: always()
48+
if: always() && github.event_name != 'pull_request'
4949
with:
5050
token: ${{ secrets.CODECOV_TOKEN }}
5151
directory: ./coverage/reports/

0 commit comments

Comments
 (0)