fix workflows #3
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: Upload Python Package | ||
on: | ||
release: | ||
types: [published] | ||
push: | ||
tags: | ||
- "v*" | ||
permissions: | ||
contents: read | ||
jobs: | ||
run-tests: | ||
uses: oceanum-io/oceanum-prax-cli/.github/workflows/tests.yml@main | ||
Check failure on line 15 in .github/workflows/pypi-publish.yml GitHub Actions / .github/workflows/pypi-publish.ymlInvalid workflow file
|
||
release-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Build release distributions | ||
run: | | ||
# NOTE: put your own distribution build steps here. | ||
python -m pip install build | ||
python -m build | ||
- name: Upload distributions | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
pypi-publish-test: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'tag' && startsWith(github.ref, 'refs/tags/v') | ||
needs: | ||
- release-build | ||
- run-tests | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
# Dedicated environments with protections for publishing are strongly recommended. | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/oceanum-prax | ||
steps: | ||
- name: Retrieve release distributions | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
- name: Publish release distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@6f7e8d9c0b1a2c3d4e5f6a7b8c9d0e1f2a3b4c5d | ||
with: | ||
password: ${{ secrets.PYPI_TEST_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
pypi-publish: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
needs: | ||
- release-build | ||
- run-tests | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
# Dedicated environments with protections for publishing are strongly recommended. | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/oceanum-prax | ||
steps: | ||
- name: Retrieve release distributions | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
- name: Publish release distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@6f7e8d9c0b1a2c3d4e5f6a7b8c9d0e1f2a3b4c5d |