Repository navigation
fix: update sms contract #601
This file contains hidden or 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 will upload a Python Package using Twine when a release is created | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Publish naeural_core Python 🐍 distributions 📦 to PyPI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-n-publish: | |
| name: Build and publish Python 🐍 distributions 📦 to PyPI | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # The PyPI publish action falls back to GitHub OIDC trusted publishing | |
| # whenever no explicit password token is provided, so the workflow must | |
| # be allowed to mint an ID token for that exchange. | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade build twine | |
| - name: Bump version | |
| run: python naeural_core/main/ver.py | |
| - name: Build package | |
| run: >- | |
| python -m | |
| build | |
| --sdist | |
| --wheel | |
| --outdir dist/ | |
| - name: Set environment variable for PyPI token - export TOKEN_VAR to GITHUB_ENV | |
| id: set_pypi_token | |
| run: | | |
| ACTOR_UPPER=$(echo "${{ github.actor }}" | tr '[:lower:]' '[:upper:]') | |
| TOKEN_VAR="PYPI_${ACTOR_UPPER}" | |
| echo "TOKEN_VAR=$TOKEN_VAR" >> $GITHUB_ENV | |
| - name: Set environment variable for PyPI token - export PYPI_TOKEN to GITHUB_ENV | |
| run: | | |
| echo "Token var: ${{ env.TOKEN_VAR }}" | |
| echo "PYPI_TOKEN=${{ secrets[env.TOKEN_VAR] }}" >> $GITHUB_ENV | |
| - name: Print environment variables (for debugging) | |
| run: | | |
| echo "Actor: ${{ github.actor }}" | |
| echo "PYPI_VAR: ${{ env.TOKEN_VAR }}" | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ env.PYPI_TOKEN }} |