Skip to content

Commit

Permalink
ci(python_package.yml): change trigger to push tags matching v*.*.* f…
Browse files Browse the repository at this point in the history
…or more precise release control

feat(python_package.yml): add create-release job to automate GitHub release creation after publishing to PyPI
  • Loading branch information
NodeJSmith committed Jun 16, 2024
1 parent 603df75 commit 2b481b6
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
name: Publish Python package

on:
release:
types: [released, prereleased]
workflow_dispatch:
inputs:
commit:
description: "Commit to build from"
required: true
default: "main"
push:
tags:
- "v*.*.*"

jobs:
build-pypi-dists:
Expand Down Expand Up @@ -65,3 +60,21 @@ jobs:

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

create-release:
name: Create a release
environment:
name: release
url: https://pypi.org/p/otf-api
needs: [publish-pypi-dists]
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: "./dist"
make_latest: true

0 comments on commit 2b481b6

Please sign in to comment.