File tree Expand file tree Collapse file tree 3 files changed +95
-36
lines changed
Expand file tree Collapse file tree 3 files changed +95
-36
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Publish to Test.PyPI.org
2+
3+ on :
4+ push :
5+ branches :
6+ - develop
7+
8+ jobs :
9+ publish :
10+ environment :
11+ name : Development
12+ name : Publish distribution 📦 to Test PyPI
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout source code
16+ uses : actions/checkout@v3
17+
18+ - name : Installing python
19+ uses : actions/setup-python@v4
20+ with :
21+ python-version : ' 3.10'
22+
23+ - name : Installing git
24+ run : pip install gitpython
25+
26+ - name : Generating version file
27+ run : python freeze_version.py
28+
29+ - name : Setup python wheel
30+ run : pip install wheel
31+
32+ - name : Building Package
33+ run : python setup.py bdist_wheel
34+
35+ - name : Publish package
36+ uses : pypa/gh-action-pypi-publish@release/v1
37+ with :
38+ skip_existing : true
39+ password : ${{ secrets.PYPI_API_TOKEN }}
40+ repository_url : https://test.pypi.org/legacy/
Original file line number Diff line number Diff line change 1+ name : Check and Publish to PyPi
2+ on :
3+ push :
4+ tags :
5+ - ' *.*.*' # Eg. 0.0.1
6+ workflow_dispatch :
7+
8+ jobs :
9+ PublishToPyPi :
10+ environment :
11+ name : Production
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout source code
15+ uses : actions/checkout@v3
16+
17+ - name : Installing python 3.10
18+ uses : actions/setup-python@v4
19+ with :
20+ python-version : ' 3.10'
21+
22+ - name : Installing git
23+ run : pip install gitpython
24+
25+ - name : Generate local version
26+ run : python freeze_version.py
27+
28+ - name : Fetch local package version
29+ run : |
30+ packageLocalVersion=$(python -c 'from version import version; print(version);')
31+ echo "localVersion=$packageLocalVersion" >> $GITHUB_ENV
32+
33+ - name : Fetch remote package version
34+ run : |
35+ packageRemoteVersion=$(python -c "exec(\"import pkg_resources\\ntry: print(pkg_resources.get_distribution('python-lib-osw-validation').version)\\nexcept pkg_resources.DistributionNotFound: print('0.0.0');\")")
36+ echo "remoteVersion=$packageRemoteVersion" >> $GITHUB_ENV
37+
38+ - name : Printing local and remote versions
39+ run : echo "Local version ${{env.localVersion}} and remote version ${{env.remoteVersion}}"
40+
41+ - name : Compare local and remote version with dpkg
42+ run : dpkg --compare-versions ${{env.localVersion}} "gt" ${{env.remoteVersion}}
43+
44+
45+ - name : Setup python wheel
46+ run : pip install wheel
47+
48+ - name : Building Package
49+ run : python setup.py bdist_wheel
50+
51+ - name : Publish package
52+ uses : pypa/gh-action-pypi-publish@release/v1
53+ with :
54+ password : ${{ secrets.PYPI_API_TOKEN }}
55+
You can’t perform that action at this time.
0 commit comments