Skip to content

minor: updated CHANGELOG.md #6

minor: updated CHANGELOG.md

minor: updated CHANGELOG.md #6

# ┌───────────────────────────────────────────────────────────────┐
# │ Contents of from_tag_to_build_release_pypi.yml │
# ├───────────────────────────────────────────────────────────────┘
# │
# ├──┐From tag
# │ └──┐Build and test
# │ ├── Release to GitHub
# │ └── Deploy to PyPI
# │
# └───────────────────────────────────────────────────────────────
# ################################################################ From tag
name: Create GitHub release and deploy to PyPI from a new tag
# requirements:
# - GitHub has an environment called "release"
# - PyPI has a trusted publisher set from https://pypi.org/manage/account/publishing/
# - no need for secret PyPI token
# debug:
# git push --delete origin v1.1.0 && git tag --delete v1.1.0
# git -a && git commit --amend
# git push --force
# git tag v1.1.0 && git push --tags
on:
push:
tags:
- 'v*'
jobs:
# ################################ Build and test
build:
name: Build package
environment: production
runs-on: ubuntu-latest
# needed to push commit to repo
permissions:
contents: write
outputs:
changelog: ${{ steps.changelog.outputs.content }}
strategy:
fail-fast: true
matrix:
python-version: ["3.12"]
steps:
- name: Access source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
# needed to list changes
with:
fetch-depth: 0
token: ${{ github.token }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # 5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build wheel setuptools
python -m pip install -e .
- name: Store partial changelog for release notes
id: changelog
uses: orhun/git-cliff-action@8b17108aad4d9362649a5dae020746c2a767c90d # 3.0.2
with:
config: pyproject.toml
args: -vv --latest --strip all
env:
OUTPUT: CHANGELOG-PARTIAL.md
- name: Build package
run: |
python -m build
- name: Store package
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 4.3.1
with:
name: python-dist
path: dist
# ################ Release to GitHub
release:
name: Release to GitHub
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Access package
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # 4.1.4
with:
name: python-dist
path: dist
# https://raw.githubusercontent.com/orhun/git-cliff/main/.github/workflows/cd.yml
- name: Create release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # 2.0.4
with:
name: Rusticlone ${{ github.ref_name }}
body: ${{ needs.build.outputs.changelog }}
draft: false
token: ${{ github.token }}
fail_on_unmatched_files: true
files: dist/*.whl
# ################ Deploy to PyPI
pypi:
name: Deploy to PyPI
needs: build
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Access package
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # 4.1.4
with:
name: python-dist
path: dist
- name: Deploy package
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # 1.8.14