Skip to content

2.11.3

2.11.3 #24

Workflow file for this run

name: Release
on:
release:
types: [released]
concurrency:
group: release
cancel-in-progress: false
jobs:
package_python3:
name: Create sdist and Python 3 Wheel
runs-on: ubuntu-latest
outputs:
sdist: ${{ steps.package.outputs.sdist }}
wheel: ${{ steps.package.outputs.wheel }}
container:
image: danielflook/python-minifier-build:python3.13-2024-09-15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
show-progress: 'false'
- name: Set version statically
run: |
VERSION=${{ github.event.release.tag_name }}
sed -i "s/setup_requires=.*/version='$VERSION',/; s/use_scm_version=.*//" setup.py
echo "Version: $VERSION"
- name: Build distribution packages
id: package
run: |
pip3 install --upgrade build
python3 -m build
echo "sdist=$(find dist -name '*.tar.gz' -printf "%f\n")" >> "$GITHUB_OUTPUT"
echo "wheel=$(find dist -name '*-py3-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: dist-sdist
path: dist/${{ steps.package.outputs.sdist }}
if-no-files-found: error
- name: Upload Python 3 wheel artifact
uses: actions/upload-artifact@v4
with:
name: dist-py3-wheel
path: dist/${{ steps.package.outputs.wheel }}
if-no-files-found: error
package_python2:
name: Create Python 2 Wheel
runs-on: ubuntu-latest
needs: [package_python3]
outputs:
wheel: ${{ steps.package.outputs.wheel }}
container:
image: danielflook/python-minifier-build:python2.7-2024-09-15
steps:
- name: Download source distribution artifact
uses: actions/download-artifact@v4
with:
name: dist-sdist
path: dist/
- name: Build Python 2 wheel
id: package
run: |
dnf install -y findutils
pip install --upgrade wheel
pip wheel dist/${{ needs.package_python3.outputs.sdist }} -w dist
echo "wheel=$(find dist -name '*-py2-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
- name: Upload Python 2 wheel artifact
uses: actions/upload-artifact@v4
with:
name: dist-py2-wheel
path: dist/${{ steps.package.outputs.wheel }}
if-no-files-found: error
documentation:
name: Test Documentation
runs-on: ubuntu-latest
needs: [package_python3]
container:
image: danielflook/python-minifier-build:python3.13-2024-09-15
steps:
- uses: actions/download-artifact@v4
with:
name: dist-sdist
path: dist/
- name: Install package
run: |
pip3 install dist/${{needs.package_python3.outputs.sdist}}
pyminify --version
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
show-progress: 'false'
- name: Build documentation
run: |
pip3 install sphinx sphinxcontrib-programoutput sphinx_rtd_theme
sphinx-build docs/source /tmp/build
- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v3
with:
path: /tmp/build
publish-to-pypi:
name: Publish to PyPI
needs:
- package_python3
- package_python2
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/python-minifier/${{ github.event.release.tag_name }}
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist/
merge-multiple: 'true'
- name: Publish package distributions to PyPI
uses: pypa/[email protected]
with:
print-hash: true
verbose: true
publish-docs:
name: Publish Documentation
needs:
- documentation
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4