Skip to content

chore(deps): update actions/setup-python action to v7 #5278

chore(deps): update actions/setup-python action to v7

chore(deps): update actions/setup-python action to v7 #5278

Workflow file for this run

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Distribution
on:
push:
branches-ignore:
- renovate/**
- dependabot/**
tags:
- '*'
pull_request:
permissions:
contents: read
jobs:
setup:
name: Build packages
runs-on: ubuntu-24.04
permissions:
attestations: write
contents: read
id-token: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: false
version: 0.11.29
- name: Install dependencies
run: uv pip install --system -e .[dev]
- name: build sdist
run: uv build
- name: twine
run: uvx twine check dist/*
- name: pydistcheck
run: uvx pydistcheck --inspect dist/*
- name: pyroma
run: uvx pyroma dist/*.tar.gz
- name: check-wheel-contents
run: uvx check-wheel-contents dist/*.whl
- name: check-manifest
run: uvx check-manifest -v
- name: Package version
id: package
run: python -c "from wlc.const import __version__; print(f'version={__version__}')" >> "$GITHUB_OUTPUT"
- name: Install Syft
id: syft
uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0
with:
syft-version: v1.38.0
- name: Generate package SBOMs
env:
SYFT: ${{ steps.syft.outputs.cmd }}
VERSION: ${{ steps.package.outputs.version }}
run: |
mkdir -p dist/sboms
"$SYFT" "dist/wlc-$VERSION.tar.gz" -o "cyclonedx-json=dist/sboms/wlc-$VERSION.tar.gz.cdx.json"
"$SYFT" "dist/wlc-$VERSION-py3-none-any.whl" -o "cyclonedx-json=dist/sboms/wlc-$VERSION-py3-none-any.whl.cdx.json"
- name: Attest package provenance
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'WeblateOrg/wlc'
uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0
with:
subject-path: |
dist/wlc-${{ steps.package.outputs.version }}.tar.gz
dist/wlc-${{ steps.package.outputs.version }}-py3-none-any.whl
- name: Attest source package SBOM
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'WeblateOrg/wlc'
uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0
with:
subject-path: dist/wlc-${{ steps.package.outputs.version }}.tar.gz
sbom-path: dist/sboms/wlc-${{ steps.package.outputs.version }}.tar.gz.cdx.json
- name: Attest wheel SBOM
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'WeblateOrg/wlc'
uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0
with:
subject-path: dist/wlc-${{ steps.package.outputs.version }}-py3-none-any.whl
sbom-path: dist/sboms/wlc-${{ steps.package.outputs.version }}-py3-none-any.whl.cdx.json
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: |
dist/*.tar.gz
dist/*.whl
dist/sboms/*.json
name: dist
release_pypi:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'WeblateOrg/wlc'
runs-on: ubuntu-24.04
name: Publish release to PyPI
permissions:
contents: read
# this permission is mandatory for trusted publishing
id-token: write
needs:
- setup
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist
- name: Prepare packages
run: |
mkdir packages
cp dist/*.tar.gz dist/*.whl packages/
- name: Publish package
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # release/v1
with:
packages-dir: packages
release_github:
runs-on: ubuntu-24.04
name: Create release on GitHub
permissions:
contents: write
needs:
- setup
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'WeblateOrg/wlc'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist
- env:
VERSION: ${{ github.ref_name }}
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$VERSION" --verify-tag --generate-notes dist/*.tar.gz dist/*.whl dist/sboms/*.json