Merge pull request #998 from radis/uncertainity_hitran #37
Workflow file for this run
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 uploads a Python Package to TestPyPI for validation. | |
| # Uses OIDC Trusted Publishing (no API tokens needed). | |
| # For setup instructions: https://docs.pypi.org/trusted-publishers/adding-a-publisher/ | |
| # | |
| # IMPORTANT: On TestPyPI, the Trusted Publisher must be configured with: | |
| # - Owner: radis | |
| # - Repository: radis | |
| # - Workflow: publish-testPypi.yml | |
| # - Environment: testPypi-deploy | |
| # | |
| # Trigger: push of a version tag (e.g. v0.16.4 or 0.16.4) to develop/master. | |
| # This avoids running a full publish attempt on every single commit. | |
| name: Upload Python Package to test PyPI | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| git-ref: | |
| description: "Git ref (branch or tag) to build and publish from" | |
| required: false | |
| default: "develop" | |
| push: | |
| tags: | |
| - 'v[0-9]*' # matches v0.16.4, v1.0.0, etc. | |
| - '[0-9]*' # matches 0.16.4, 1.0.0, etc. (tagless style) | |
| # How to run it manually: | |
| # | |
| # 1. In GitHub, open Actions. | |
| # 2. Select Upload Python Package to test PyPI. | |
| # 3. Click Run workflow. | |
| # 4. Choose the branch containing this workflow file. | |
| # 5. Set git-ref to what you want to test: | |
| # develop | |
| # master | |
| # a specific tag like v0.16.4 | |
| # 6. Click Run. | |
| permissions: | |
| contents: read | |
| jobs: | |
| release-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.git-ref || github.ref }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Build release distributions | |
| run: | | |
| python -m pip install build | |
| python -m build --sdist --wheel | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| test-pypi-publish: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - release-build | |
| permissions: | |
| id-token: write # required for OIDC Trusted Publishing | |
| environment: | |
| name: testPypi-deploy | |
| url: https://test.pypi.org/project/radis/ | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| - name: Publish release distributions to Test PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| repository-url: https://test.pypi.org/legacy/ | |
| skip-existing: true | |
| verbose: true |