name: "CD: cua-cloud (PyPI)" on: push: tags: - "cloud-v*" workflow_dispatch: inputs: version: description: "Version to publish (without v prefix)" required: true default: "0.1.0" workflow_call: inputs: version: description: "Version to publish" required: true type: string permissions: contents: write jobs: prepare: runs-on: macos-latest outputs: version: ${{ steps.get-version.outputs.version }} steps: - uses: actions/checkout@v4 - name: Determine version id: get-version run: | if [ -n "${{ inputs.version }}" ]; then VERSION=${{ inputs.version }} elif [ "${{ github.event_name }}" == "push" ]; then if [[ "${{ github.ref }}" =~ ^refs/tags/cloud-v([0-9]+\.[0-9]+\.[0-9]+) ]]; then VERSION=${BASH_REMATCH[1]} else echo "Invalid tag format for cloud" exit 1 fi elif [ -n "${{ github.event.inputs.version }}" ]; then VERSION=${{ github.event.inputs.version }} else echo "ERROR: No version found!" exit 1 fi echo "version=$VERSION" >> $GITHUB_OUTPUT publish: needs: prepare uses: ./.github/workflows/py-reusable-publish.yml with: package_name: "cloud" package_dir: "libs/python/cua-cloud" version: ${{ needs.prepare.outputs.version }} base_package_name: "cua-cloud" secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} create-release: needs: [prepare, publish] uses: ./.github/workflows/release-github-reusable.yml with: tag_name: "cloud-v${{ needs.prepare.outputs.version }}" release_name: "cua-cloud v${{ needs.prepare.outputs.version }}" module_path: "libs/python/cua-cloud" body: ""