Skip to content

Commit

Permalink
Fix CD
Browse files Browse the repository at this point in the history
  • Loading branch information
mlech-reef committed May 22, 2023
1 parent 7f0e323 commit 9866d38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,21 @@ jobs:
run: nox -vs build
- name: Read the Changelog
id: read-changelog
uses: mindsers/changelog-reader-action@v1
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.build.outputs.version }}
- name: Create GitHub release
- name: Create GitHub release and upload the distribution
id: create-release
uses: actions/create-release@v1
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.build.outputs.version }}
body: ${{ steps.read-changelog.outputs.log_entry }}
draft: false
name: ${{ steps.build.outputs.version }}
body: ${{ steps.read-changelog.outputs.changes }}
draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
prerelease: false
- name: Upload the distribution to GitHub
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.build.outputs.asset_path }}
asset_name: ${{ steps.build.outputs.asset_name }}
asset_content_type: application/gzip
files: ${{ steps.build.outputs.asset_path }}
- name: Upload the distribution to PyPI
if: ${{ env.B2_PYPI_PASSWORD != '' }}
uses: pypa/gh-action-pypi-publish@v1.3.1
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ env.B2_PYPI_PASSWORD }}
13 changes: 6 additions & 7 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,13 @@ def build(session):

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

asset_name = os.path.basename(asset_path)
print('::set-output name=asset_name::', asset_name, sep='')

version = os.environ['GITHUB_REF'].replace('refs/tags/v', '')
print('::set-output name=version::', version, sep='')
version = os.environ['GITHUB_REF'].replace('refs/tags/v', '')
print(f'version={version}', file=github_output)


@nox.session(python=PYTHON_DEFAULT_VERSION)
Expand Down

0 comments on commit 9866d38

Please sign in to comment.