Trigger on tagging #26
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: Build, test and publish to testPyPI | |
on: | |
push: | |
tags: | |
- 'v*' # matches semantic versioning (e.g., v1.2.3) | |
branches: | |
- dev | |
- hotfix | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yml | |
publish-to-testpypi: | |
name: Publish to TestPyPI | |
# Only on dev pushes | |
# if: ${{ github.event_name == 'push' && ( github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' ) }} | |
# Run on untagged push | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/elastic | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@main | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |