Skip to content

bump: version 0.1.0 β†’ 1.0.0 #1

bump: version 0.1.0 β†’ 1.0.0

bump: version 0.1.0 β†’ 1.0.0 #1

Workflow file for this run

name: "Python: CD"
on:
push:
tags:
- "*.*.*"
jobs:
build:
name: Build package
runs-on: ubuntu-latest
outputs:
package-version: ${{ steps.package-version.outputs.package-version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
- run: python -m pip install --upgrade pip
- run: python -m pip install build
- run: python -m build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
- id: package-version
run: |
python -m pip install .
echo "package-version=$(
python -c 'import sys, xlsx_serializer; sys.stdout.write(xlsx_serializer.__version__)'
)" >> $GITHUB_OUTPUT
check-tag:
name: Check tag
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
if [ "${{ needs.build.outputs.package-version }}" != "${{ github.ref_name }}" ]; then
exit 1
fi
pypi:
name: Publish package to PyPI
needs:
- check-tag
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: PyPI
url: https://pypi.org/p/django-xlsx-serializer/
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
release:
name: Create GitHub release
needs:
- pypi
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true