Skip to content

Commit

Permalink
release with dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Jan 28, 2025
1 parent 885fb9a commit 665f66d
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,50 @@
name: Upload Python Package
name: Bump version and publish

on:
push:
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: ./actions/uv/build
- name: Generate Tag
uses: ./actions/uv/tag
with:
working-directory: '.github/hello-world'
github_token: ${{ secrets.GITHUB_TOKEN }}

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

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

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

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

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 665f66d

Please sign in to comment.