Skip to content

full release flow dry run #11

full release flow dry run

full release flow dry run #11

Workflow file for this run

name: release
on:
push:
release:
types: [published]
inputs:
release-pypi:
required: true
type: boolean
default: true
workflow_dispatch:
inputs:
release-pypi:
required: true
type: boolean
description: "if true a release is made on PyPI"
release-test-pypi:
type: boolean
description: "if true a release is made on Test PyPI"
jobs:
test:
uses: ./.github/workflows/test.yml
secrets: inherit
build:
needs: test
uses: ./.github/workflows/build.yml
docs:
needs: test
uses: ./.github/workflows/docs.yml
secrets: inherit
# release-pypi:
# needs: [build]
# runs-on: ubuntu-latest
# if: github.event.inputs.release-pypi == 'true' && startsWith(github.ref, 'refs/tags/')
# environment:
# name: pypi
# url: https://pypi.org/p/ocp-models
#
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
#
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: artifact
# path: dist
#
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# verbose: true
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
release-test-pypi:
needs: [build]
runs-on: ubuntu-latest
# if: github.event.inputs.release-test-pypi == 'true'
environment:
name: testpypi
url: https://test.pypi.org/p/ocp-models
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}