Skip to content

Commit 7e08dad

Browse files
authored
Merge pull request #279 from reef-technologies/build_wheel
chore: build python wheels as well
2 parents df4a1db + 9866d38 commit 7e08dad

File tree

3 files changed

+17
-24
lines changed

3 files changed

+17
-24
lines changed

.github/workflows/cd.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,21 @@ jobs:
3030
run: nox -vs build
3131
- name: Read the Changelog
3232
id: read-changelog
33-
uses: mindsers/changelog-reader-action@v1
33+
uses: mindsers/changelog-reader-action@v2
3434
with:
3535
version: ${{ steps.build.outputs.version }}
36-
- name: Create GitHub release
36+
- name: Create GitHub release and upload the distribution
3737
id: create-release
38-
uses: actions/create-release@v1
38+
uses: softprops/action-gh-release@v1
3939
with:
40-
tag_name: ${{ github.ref }}
41-
release_name: ${{ steps.build.outputs.version }}
42-
body: ${{ steps.read-changelog.outputs.log_entry }}
43-
draft: false
40+
name: ${{ steps.build.outputs.version }}
41+
body: ${{ steps.read-changelog.outputs.changes }}
42+
draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
4443
prerelease: false
45-
- name: Upload the distribution to GitHub
46-
uses: actions/upload-release-asset@v1
47-
with:
48-
upload_url: ${{ steps.create-release.outputs.upload_url }}
49-
asset_path: ${{ steps.build.outputs.asset_path }}
50-
asset_name: ${{ steps.build.outputs.asset_name }}
51-
asset_content_type: application/gzip
44+
files: ${{ steps.build.outputs.asset_path }}
5245
- name: Upload the distribution to PyPI
5346
if: ${{ env.B2_PYPI_PASSWORD != '' }}
54-
uses: pypa/gh-action-pypi-publish@v1.3.1
47+
uses: pypa/gh-action-pypi-publish@release/v1
5548
with:
5649
user: __token__
5750
password: ${{ env.B2_PYPI_PASSWORD }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Infrastructure
1616
* Remove dependency from `arrow`
17+
* Build Python wheels for distribution
1718

1819
## [1.20.0] - 2023-03-23
1920

noxfile.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
'pyfakefs==4.5.6',
4141
'pytest-xdist==2.5.0',
4242
]
43-
REQUIREMENTS_BUILD = ['setuptools>=20.2']
43+
REQUIREMENTS_BUILD = ['setuptools>=20.2', 'wheel>=0.40']
4444

4545
nox.options.reuse_existing_virtualenvs = True
4646
nox.options.sessions = [
@@ -169,22 +169,21 @@ def cover(session):
169169
@nox.session(python=PYTHON_DEFAULT_VERSION)
170170
def build(session):
171171
"""Build the distribution."""
172-
# TODO: consider using wheel as well
173172
session.run('pip', 'install', *REQUIREMENTS_BUILD)
174173
session.run('python', 'setup.py', 'check', '--metadata', '--strict')
175174
session.run('rm', '-rf', 'build', 'dist', 'b2sdk.egg-info', external=True)
176175
session.run('python', 'setup.py', 'sdist', *session.posargs)
176+
session.run('python', 'setup.py', 'bdist_wheel', *session.posargs)
177177

178178
# Set outputs for GitHub Actions
179179
if CI:
180-
asset_path = glob('dist/*')[0]
181-
print('::set-output name=asset_path::', asset_path, sep='')
180+
with open(os.environ['GITHUB_OUTPUT'], 'a') as github_output:
181+
# Path have to be specified with unix style slashes even for windows,
182+
# otherwise glob won't find files on windows in action-gh-release.
183+
print('asset_path=dist/*', file=github_output)
182184

183-
asset_name = os.path.basename(asset_path)
184-
print('::set-output name=asset_name::', asset_name, sep='')
185-
186-
version = os.environ['GITHUB_REF'].replace('refs/tags/v', '')
187-
print('::set-output name=version::', version, sep='')
185+
version = os.environ['GITHUB_REF'].replace('refs/tags/v', '')
186+
print(f'version={version}', file=github_output)
188187

189188

190189
@nox.session(python=PYTHON_DEFAULT_VERSION)

0 commit comments

Comments
 (0)