Skip to content

Commit

Permalink
chore: add pypi action
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Jul 29, 2023
1 parent 7cb70fb commit f046cf9
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
73 changes: 73 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release to PyPI

permissions:
contents: write

on:
push:
tags:
- "v*"

jobs:
build:
name: build dist files
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.9

- name: install build
run: python -m pip install --upgrade build

- name: build dist
run: python -m build

- uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist/*
if-no-files-found: error

publish:
environment:
name: pypi-release
url: https://pypi.org/project/joserfc/
permissions:
id-token: write
name: release to pypi
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
with:
name: artifacts
path: dist

- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

release:
name: write release note
runs-on: ubuntu-latest
needs: publish

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npx changelogithub --no-group
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A captcha library that generates audio and image CAPTCHAs.
[![GitHub Sponsor](https://badgen.net/badge/support/captcha/blue?icon=github)](https://github.com/sponsors/lepture)
[![Build Status](https://github.com/lepture/captcha/actions/workflows/test.yml/badge.svg)](https://github.com/lepture/captcha/actions)
[![PyPI](https://badgen.net/pypi/v/captcha)](https://pypi.org/project/captcha)
[![Code Coverage](https://codecov.io/gh/lepture/captcha/branch/main/graph/badge.svg?token=WCD9X8HKI1)](https://codecov.io/gh/lepture/captcha)
[![codecov](https://codecov.io/gh/lepture/captcha/branch/master/graph/badge.svg?token=xLjcXGMaeo)](https://codecov.io/gh/lepture/captcha)

## Install

Expand Down

0 comments on commit f046cf9

Please sign in to comment.