1- # this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2- # help make automated releases for this project
1+ # This workflow will upload a Python Package using Twine when a release is created
2+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
33
4- name : Release
4+ # This workflow uses actions that are not certified by GitHub.
5+ # They are provided by a third-party and are governed by
6+ # separate terms of service, privacy policy, and support
7+ # documentation.
8+
9+ name : Upload Python Package
510
611on :
712 release :
8- types : [created]
13+ types : [published]
14+
15+ permissions :
16+ contents : read
917
1018jobs :
11- build-and-publish :
12- runs-on : ubuntu-22.04
19+ deploy :
20+
21+ runs-on : ubuntu-latest
22+
1323 steps :
14- - name : Checkout
15- uses : actions/checkout@v2
24+ - uses : actions/checkout@v3
1625 - name : Set up Python
17- uses : actions/setup-python@v1
26+ uses : actions/setup-python@v3
1827 with :
19- python-version : " 3.10.11"
20- - name : Install build dependencies
21- run : python -m pip install -U setuptools wheel build
22- - name : Build
23- run : python -m build .
24- - name : Publish
25- uses : pypa/gh-action-pypi-publish@master
28+ python-version : ' 3.x'
29+ - name : Install dependencies
30+ run : |
31+ python -m pip install --upgrade pip
32+ pip install build
33+ - name : Build package
34+ run : python -m build
35+ - name : Publish package
36+ uses : pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
2637 with :
27- password : ${{ secrets.pypi_test_password }}
28- skip_existing : true
29-
30- generate_and_upload_coverage :
31- name : Generate and Upload Coverage Report
32- runs-on : ubuntu-22.04
33- strategy :
34- fail-fast : false
35- matrix :
36- python-version : ["3.10.11"]
37-
38- steps :
39- - name : Checkout code
40- uses : actions/checkout@v2
41-
42- - name : Set up Python
43- uses : actions/setup-python@v2
44- with :
45- python-version : ${{ matrix.python-version }}
46-
47- - name : Update Pip
48- run : pip install --upgrade pip
49- pip install --use-pep517
50-
51- - name : Create and activate virtual environment
52- run : |
53- python -m venv venv
54- source venv/bin/activate
55-
56- - name : Install build dependencies
57- run : python -m pip install -U setuptools wheel build
58-
59- - name : Install dependencies
60- run : pip install -r requirements.txt
61-
62- - name : Run tests and generate coverage report
63- run : |
64- coverage run -m pytest
65- coverage report -m > coverage.txt
66-
67- - name : Archive coverage report
68- uses : actions/upload-artifact@v2
69- with :
70- name : coverage-report
71- path : coverage.txt
72-
73- - name : Configure AWS credentials
74- uses : aws-actions/configure-aws-credentials@v1
75- with :
76- aws-access-key-id : ${{ secrets.Test_AWS_ACCESS_KEY_ID }}
77- aws-secret-access-key : ${{ secrets.Test_AWS_SECRET_ACCESS_KEY }}
78- aws-region : <your_aws_region> # Replace with your actual AWS region
79-
80- - name : Upload coverage report to S3
81- run : aws s3 cp coverage.txt s3://<your_bucket_name>/coverage.txt
38+ user : __token__
39+ password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments