Skip to content

Commit

Permalink
dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Jan 28, 2025
1 parent 68a5e07 commit cfda4b6
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
name: Upload Python Package
name: Bump version and publish

on:
release:
types: [published]
workflow_dispatch:
workflow_run:
workflows: [ "CI" ]
types: [ completed ]

jobs:
build:
tag:
permissions:
contents: write

if: >
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'main')
runs-on: ubuntu-latest

steps:
- name: Checkout [${{ github.repository }}]
uses: actions/checkout@v4

- uses: cvxgrp/.github/actions/uv/[email protected]
- name: Generate Tag
uses: cvxgrp/.github/actions/uv/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

deploy:
publish:
needs: tag
runs-on: ubuntu-latest
needs: build
environment: release

permissions:
contents: read
# This permission is required for trusted publishing.
id-token: write

steps:
- name: Checkout [${{ github.repository }}]
uses: actions/checkout@v4

# download dist from build
- uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Publish package distributions to PyPI
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/

0 comments on commit cfda4b6

Please sign in to comment.