Bump version to 0.6.0 (#433) #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish mosaicml-streaming to PyPI / GitHub | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
pre-commit: | |
uses: ./.github/workflows/linting.yaml | |
test: | |
uses: ./.github/workflows/pytest.yaml | |
build-n-publish: | |
needs: | |
- pre-commit | |
- test | |
name: Build/publish to PyPI and create GitHub release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.x" | |
- name: Build source and wheel distributions | |
run: | | |
python -m pip install --upgrade build twine | |
python -m build | |
twine check --strict dist/* | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
# - name: Publish distribution 📦 to Test PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Get Asset name | |
run: | | |
export PKG=$(ls dist/ | grep tar) | |
set -- $PKG | |
echo "name=$1" >> $GITHUB_ENV | |
- name: Upload Release Asset (sdist) to GitHub | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/${{ env.name }} | |
asset_name: ${{ env.name }} | |
asset_content_type: application/zip |