Skip to content

ci(package-publishing-script): update package publishing script #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
name: Publish Package

on:
workflow_dispatch
workflow_dispatch:
inputs:
Version:
description: "Version to be released in format: x.y.z, where x => major version, y => minor version and z => patch version"
required: true
default: "0.1.0"
Title:
description: "Title of the release"
required: true
default: "Improving API developer experience"

jobs:
publish-package:
environment: Production
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -18,6 +31,22 @@ jobs:
python -m build
twine check --strict dist/*
- name: Publish distribution to PyPI
id: release
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
password: ${{ secrets.PYPI_TOKEN }}
- name: Create tag
if: steps.release.outputs.exit_code == 0
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.TAGS_TOKEN }}
custom_tag: ${{ github.event.inputs.Version }}
tag_prefix: ""
- name: Create changelog for the release
if: steps.release.outputs.exit_code == 0
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ github.event.inputs.Title }}
body: ${{ steps.tag_version.outputs.changelog }}