Skip to content

Commit

Permalink
Merge pull request #2367 from Kozea/release
Browse files Browse the repository at this point in the history
Add action for release
  • Loading branch information
liZe authored Jan 30, 2025
2 parents 3fce261 + c2acac4 commit 57abf0e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release new version
on:
push:
tags:
- v*

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/weasyprint
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install requirements
run: python -m pip install flit
- name: Build packages
run: flit build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
add-version:
name: Add version to GitHub
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install requirements
run: sudo apt-get install pandoc
- name: Generate content
run: |
pandoc docs/changelog.rst -f rst -t gfm | csplit - /##/ "{1}" -f .part
sed -r "s/^([A-Z].*)\:\$/## \1/" .part01 | sed -r "s/^ *//" | sed -rz "s/([^\n])\n([^\n^-])/\1 \2/g" | tail -n +5 > .body
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: .body

0 comments on commit 57abf0e

Please sign in to comment.