File tree Expand file tree Collapse file tree 4 files changed +103
-0
lines changed
Expand file tree Collapse file tree 4 files changed +103
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ python-version : ["3.8", "3.9", "3.10", "3.11"]
15+
16+ steps :
17+ - uses : actions/checkout@v3
18+
19+ - name : Set up Python ${{ matrix.python-version }}
20+ uses : actions/setup-python@v4
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+
24+ - name : Install dependencies
25+ run : |
26+ python -m pip install --upgrade pip
27+ pip install pytest
28+ pip install -e .
29+
30+ - name : Run tests
31+ run : |
32+ pytest
33+
34+ build-and-publish :
35+ needs : test
36+ runs-on : ubuntu-latest
37+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
38+
39+ steps :
40+ - uses : actions/checkout@v3
41+
42+ - name : Set up Python
43+ uses : actions/setup-python@v4
44+ with :
45+ python-version : " 3.11"
46+
47+ - name : Install build dependencies
48+ run : |
49+ python -m pip install --upgrade pip
50+ pip install build twine
51+
52+ - name : Build package
53+ run : python -m build
54+
55+ - name : Publish to PyPI
56+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
57+ env :
58+ TWINE_USERNAME : __token__
59+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
60+ run : |
61+ twine upload dist/*
Original file line number Diff line number Diff line change 1+
2+ # This package is used to generate the index.html file for the python package index.
Original file line number Diff line number Diff line change 1+ name : " Python Package Index Generator"
2+ description : " Generates an index.html file for hosting a private Python package repository"
3+ author : " EarningsCall"
4+
5+ inputs :
6+ s3_bucket_name :
7+ description : " S3 bucket name"
8+ required : true
9+ default : " EarningsCall"
10+
11+ runs :
12+ using : " composite"
13+ steps :
14+ - name : Set up Python
15+ uses : actions/setup-python@v4
16+ with :
17+ python-version : " 3.11"
18+
19+ - name : Install dependencies
20+ shell : bash
21+ run : |
22+ python -m pip install boto3 botocore
23+
24+ - name : Generate Index
25+ shell : bash
26+ run : |
27+ python ${{ github.action_path }}/generat-index.py --s3-bucket-name ${{ inputs.s3_bucket_name }}
28+
29+ branding :
30+ icon : " package"
31+ color : " blue"
Original file line number Diff line number Diff line change 1+ import argparse
2+
3+
4+ parser = argparse .ArgumentParser (description = '' )
5+ parser .add_argument ("--s3-bucket-name" , type = str , help = "S3 bucket name" )
6+
7+
8+ print ("Hello World!" )
9+
You can’t perform that action at this time.
0 commit comments