Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Automate publishing to PyPI on tag #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

# Always tests wheel building, but only publish to PyPI on pushed tags.
on:
pull_request:
paths-ignore:
- ".github/workflows/*.yaml"
- "!.github/workflows/release.yaml"
push:
paths-ignore:
- ".github/workflows/*.yaml"
- "!.github/workflows/release.yaml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags: ["**"]
workflow_dispatch:

jobs:
build-release:
runs-on: ubuntu-22.04
permissions:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: install build package
run: |
pip install --upgrade pip
pip install build
pip freeze

- name: build release
run: |
python -m build --sdist --wheel .
ls -l dist

- name: publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')