@@ -52,22 +52,54 @@ jobs:
52
52
PCAPKIT_TAG_EXISTS : ${{ steps.check_tag.outputs.exists }}
53
53
PCAPKIT_CONDA_LABEL : ${{ steps.get_version.outputs.PCAPKIT_CONDA_LABEL }}
54
54
55
- pypi_github :
56
- name : PyPI & GitHub Release # with Python ${{ matrix.python-version }}
55
+ github :
56
+ name : GitHub Release
57
57
runs-on : ubuntu-latest
58
58
needs : [ version_check ]
59
59
if : ${{ startsWith(github.ref_name, 'v') || needs.version_check.outputs.PCAPKIT_TAG_EXISTS == 'false' }}
60
- # strategy:
61
- # matrix:
62
- # python-version:
63
- # - "3.7"
64
- # - "3.8"
65
- # - "3.9"
66
- # - "3.10"
67
- # - "3.11"
68
- # - "pypy3.7"
69
- # - "pypy3.8"
70
- # - "pypy3.9"
60
+ steps :
61
+ - name : Checkout code
62
+ uses : actions/checkout@v3
63
+ with :
64
+ fetch-depth : 0
65
+
66
+ - name : Changelog
67
+ uses : Bullrich/generate-release-changelog@master
68
+ id : changelog
69
+ env :
70
+ REPO : ${{ github.repository }}
71
+
72
+ - name : Create Release
73
+ id : create_release
74
+ uses : ncipollo/release-action@v1.12.0
75
+ env :
76
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
77
+ with :
78
+ # allowUpdates: true
79
+ # artifacts: |
80
+ # dist/*
81
+ # body: ${{ env.PCAPKIT_CHANGELOG }}
82
+ body : |
83
+ ${{ steps.changelog.outputs.changelog }}
84
+ # generateReleaseNotes: true
85
+ # makeLatest: true
86
+ name : PyPCAPKit v${{ needs.version_check.outputs.PCAPKIT_VERSION }}
87
+ prerelease : ${{ needs.version_check.outputs.PCAPKIT_PRERELEASE }}
88
+ tag : " v${{ needs.version_check.outputs.PCAPKIT_VERSION }}"
89
+ token : " ${{ secrets.GITHUB_TOKEN }}"
90
+
91
+ pypi :
92
+ name : PyPI distribution for Python ${{ matrix.python-version }}
93
+ runs-on : ubuntu-latest
94
+ needs : [ github, version_check ]
95
+ if : ${{ startsWith(github.ref_name, 'v') || needs.version_check.outputs.PCAPKIT_TAG_EXISTS == 'false' }}
96
+ strategy :
97
+ matrix :
98
+ python-version :
99
+ - " 3.8"
100
+ - " 3.9"
101
+ - " 3.10"
102
+ - " 3.11"
71
103
steps :
72
104
- name : Checkout code
73
105
uses : actions/checkout@v3
76
108
77
109
- uses : actions/setup-python@v4
78
110
with :
79
- python-version : ' 3.11 ' # ${{ matrix.python-version }}
111
+ python-version : ${{ matrix.python-version }}
80
112
81
113
- name : Install and Setup
82
114
run : |
@@ -85,15 +117,19 @@ jobs:
85
117
python -m pip install -U pip setuptools wheel
86
118
python -m pip install -U build
87
119
88
- - name : Build Package (latest)
89
- # if: ${{ matrix.python-version == '3.11' }}
120
+ - name : Build Package
121
+ env :
122
+ PCAPKIT_VERSION : ${{ needs.version_check.outputs.PCAPKIT_VERSION }}
90
123
run : |
91
124
python -m build
92
125
93
- # - name: Build Package (others)
94
- # if: ${{ matrix.python-version != '3.11' }}
95
- # run: |
96
- # python -m build --wheel
126
+ # rename wheel's python tag
127
+ python util/wheel_rename.py dist/*.whl
128
+
129
+ - name : No Source Distribution for Python ${{ matrix.python-version }}
130
+ if : ${{ matrix.python-version != '3.11' }}
131
+ run : |
132
+ rm dist/*.tar.gz
97
133
98
134
- name : Publish to PyPI
99
135
uses : pypa/gh-action-pypi-publish@release/v1
@@ -108,52 +144,6 @@ jobs:
108
144
repository-url : https://test.pypi.org/legacy/
109
145
skip-existing : true
110
146
111
- - name : Changelog
112
- uses : Bullrich/generate-release-changelog@master
113
- id : changelog
114
- env :
115
- REPO : ${{ github.repository }}
116
-
117
- # run: |
118
- # # NOTE: inspired from Bullrich/generate-release-changelog
119
- # # https://github.com/Bullrich/generate-release-changelog/blob/master/entrypoint.sh
120
-
121
- # tag=$(git tag --sort version:refname | tail -n 2 | head -n 1)
122
- # echo tag=$tag
123
-
124
- # if [ "$tag" ]; then
125
- # changelog=$(git log --oneline --no-decorate $tag..HEAD)
126
- # else
127
- # changelog=$(git log --oneline --no-decorate)
128
- # fi
129
-
130
- # echo $changelog
131
-
132
- # changelog="${changelog//'%'/'%25'}"
133
- # changelog="${changelog//$'\n'/'%0A' - }"
134
- # changelog=" - ${changelog//$'\r'/'%0D'}"
135
-
136
- # echo "PCAPKIT_CHANGELOG=$changelog" >> $GITHUB_ENV
137
-
138
- - name : Create Release
139
- id : create_release
140
- uses : ncipollo/release-action@v1.12.0
141
- env :
142
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
143
- with :
144
- # allowUpdates: true
145
- artifacts : |
146
- dist/*
147
- # body: ${{ env.PCAPKIT_CHANGELOG }}
148
- body : |
149
- ${{ steps.changelog.outputs.changelog }}
150
- # generateReleaseNotes: true
151
- # makeLatest: true
152
- name : PyPCAPKit v${{ needs.version_check.outputs.PCAPKIT_VERSION }}
153
- prerelease : ${{ needs.version_check.outputs.PCAPKIT_PRERELEASE }}
154
- tag : " v${{ needs.version_check.outputs.PCAPKIT_VERSION }}"
155
- token : " ${{ secrets.GITHUB_TOKEN }}"
156
-
157
147
conda :
158
148
name : Conda deployment of package with Python ${{ matrix.python-version }}
159
149
runs-on : ubuntu-latest
0 commit comments