Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
upload

GitHub Action

Python Semantic Release - Publish

v9.8.8

Python Semantic Release - Publish

upload

Python Semantic Release - Publish

Publish Artifacts & Assets to GitHub Releases

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Python Semantic Release - Publish

uses: python-semantic-release/[email protected]

Learn more about this action in python-semantic-release/publish-action

Choose a version

Python Semantic Release - Upload to GitHub Release Action

This GitHub Action runs semantic-release publish using python-semantic-release. Full documentation is available in the documentation for Python Semantic Release.

WARNING: This Action is intended to be used in conjunction with Python Semantic Release configuration of the same version! Using this Action with a different version of Python Semantic Release may result in unexpected errors.

Example usage

name: CI/CD

on:
  push:
    branches:
      - main

jobs:
  release:
    runs-on: ubuntu-latest
    concurrency: release

    permissions:
      id-token: write

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Python Semantic Release
        id: release
        uses: python-semantic-release/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          # <other options here>

      - name: Publish package to PyPI
        uses: pypa/gh-action-pypi-publish@v1
        if: steps.release.outputs.released == 'true'

      - name: Publish package to GitHub Release
        uses: python-semantic-release/[email protected]
        if: steps.release.outputs.released == 'true'
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          tag: ${{ steps.release.outputs.tag }}

Options

See action.yml for a description of the available options.