Release New Version #57
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
# This workflow is responsible for publishing packages to PyPi | |
# and creating offline packages | |
name: "Release New Version" | |
on: | |
- workflow_call | |
- workflow_dispatch | |
jobs: | |
publish: | |
name: Publish to PyPi | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Update PIP tools | |
run: | | |
python -m pip install --upgrade pip setuptools | |
python -m pip install wheel twine | |
- name: Build | |
run: python setup.py sdist bdist_wheel | |
- name: Publish to PyPi | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: twine upload dist/* | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Build off-line installer | |
id: build | |
shell: bash | |
run: | | |
output=$(python offline_installer/build.py) | |
echo "::set-output name=file_name::$output" | |
- name: Upload off-line installer | |
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/${{ steps.build.outputs.file_name }} | |
asset_name: ${{ steps.build.outputs.file_name }} | |
asset_content_type: application/zip |