mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-11-24 11:01:33 -08:00
Bumps the minor-and-patches group with 2 updates: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) and [docker/login-action](https://github.com/docker/login-action). Updates `astral-sh/setup-uv` from 8.2.0 to 8.3.2 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/fac544c07dec837d0ccb6301d7b5580bf5edae39...11f9893b081a58869d3b5fccaea48c9e9e46f990) Updates `docker/login-action` from 4.3.0 to 4.4.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/c99871dec2022cc055c062a10cc1a1310835ceb4...af1e73f918a031802d376d3c8bbc3fe56130a9b0) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: 8.3.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patches - dependency-name: docker/login-action dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patches ... Signed-off-by: dependabot[bot] <[email protected]>
206 lines
6.3 KiB
YAML
206 lines
6.3 KiB
YAML
# Copyright 2024-2025 New Vector Ltd
|
||
# Copyright 2025-2026 Element Creations Ltd
|
||
#
|
||
# SPDX-License-Identifier: AGPL-3.0-only
|
||
|
||
name: Packages linting, testing & releasing
|
||
|
||
on:
|
||
pull_request:
|
||
push:
|
||
branches:
|
||
- main
|
||
- 'maintenance/*'
|
||
tags:
|
||
# Publish on any tag starting with a `v`, e.g., v0.1.0
|
||
- ess-migration-tool-v*
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
jobs:
|
||
python:
|
||
runs-on: ubuntu-latest
|
||
strategy:
|
||
matrix:
|
||
python-version:
|
||
- "3.11"
|
||
- "3.12"
|
||
- "3.13"
|
||
- "3.14"
|
||
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Install uv
|
||
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
||
with:
|
||
enable-cache: true
|
||
activate-environment: true
|
||
python-version: ${{ matrix.python-version }}
|
||
|
||
- name: Set up UV environment
|
||
run: uv sync --all-packages --resolution lowest-direct
|
||
|
||
- name: Run ruff check
|
||
run: |
|
||
ruff check
|
||
|
||
- name: Run ruff format
|
||
run: |
|
||
ruff format --check
|
||
|
||
- name: mypy
|
||
run: |
|
||
mypy packages/ess-migration-tool
|
||
|
||
- name: pytest packages
|
||
run: |
|
||
pytest packages
|
||
|
||
- name: Build with lowest resolution
|
||
run: uv build --package ess-migration-tool
|
||
|
||
- name: pytest packages (wheel)
|
||
run: uv run --isolated --no-project --with dist/*.whl pytest packages/ess-migration-tool/tests
|
||
|
||
- name: pytest packages (source distribution)
|
||
run: uv run --isolated --no-project --with dist/*.tar.gz pytest packages/ess-migration-tool/tests
|
||
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
needs:
|
||
- python
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Install uv
|
||
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
||
with:
|
||
# We disable cache for releases to avoid cache poisoning
|
||
enable-cache: ${{ github.ref_type != 'tag' }}
|
||
activate-environment: true
|
||
|
||
- name: Set up UV environment
|
||
run: uv sync --all-packages --resolution lowest-direct
|
||
|
||
- name: Set version
|
||
env:
|
||
GITHUB_RUN_ID: "${{ github.run_id }}"
|
||
run: |
|
||
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
|
||
uv --directory packages/ess-migration-tool version "${GITHUB_REF_NAME#ess-migration-tool-v}"
|
||
else
|
||
uv version --directory packages/ess-migration-tool --bump "dev=$GITHUB_RUN_ID"
|
||
fi
|
||
|
||
- name: Build
|
||
run: uv build --package ess-migration-tool
|
||
# Check that basic features work and we didn't miss to include crucial files
|
||
- name: Smoke test (wheel)
|
||
run: |-
|
||
for version in 3.11 3.12 3.13 3.14; do
|
||
uv run --python "$version" --isolated --resolution lowest --no-project --with dist/*.whl ess-migration-tool --help
|
||
done
|
||
|
||
- name: Smoke test (source distribution)
|
||
run: |
|
||
for version in 3.11 3.12 3.13 3.14; do
|
||
uv run --python "$version" --isolated --resolution lowest --no-project --with dist/*.tar.gz ess-migration-tool --help
|
||
done
|
||
|
||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||
with:
|
||
name: ess-migration-tool-dist
|
||
path: |
|
||
dist/*
|
||
retention-days: 1
|
||
|
||
|
||
publish:
|
||
needs:
|
||
- build
|
||
environment:
|
||
name: pypi
|
||
permissions:
|
||
id-token: write
|
||
contents: write
|
||
packages: read
|
||
pull-requests: write
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||
with:
|
||
# We are creating a commit changing the chart version for the next version PR
|
||
persist-credentials: true
|
||
|
||
- name: Grab packaged dists
|
||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||
with:
|
||
name: ess-migration-tool-dist
|
||
path: ./dist
|
||
|
||
- name: Install uv
|
||
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
|
||
with:
|
||
enable-cache: true
|
||
activate-environment: true
|
||
|
||
- name: Set up UV environment
|
||
run: uv sync
|
||
|
||
- name: Generate changelog
|
||
run: |
|
||
version=$(find dist -name 'ess_migration_tool-*.tar.gz' | sed 's/.*ess_migration_tool-//;s/.tar.gz//')
|
||
# Add changes to CHANGELOG.md
|
||
uv run towncrier build --version "$version" --yes --dir packages/ess-migration-tool
|
||
echo "CHANGELOG.md will look like:"
|
||
cat packages/ess-migration-tool/CHANGELOG.md
|
||
echo ""
|
||
|
||
- name: Bump version for next PR
|
||
id: versions
|
||
run: |
|
||
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
|
||
uv --directory packages/ess-migration-tool version "${GITHUB_REF_NAME#ess-migration-tool-v}"
|
||
fi
|
||
this_version=$(uv --directory packages/ess-migration-tool version --short)
|
||
uv --directory packages/ess-migration-tool version --bump patch --bump dev=1
|
||
next_version=$(uv --directory packages/ess-migration-tool version --short)
|
||
echo "this-version=$this_version" | tee -a "$GITHUB_OUTPUT"
|
||
echo "next-version=$next_version" | tee -a "$GITHUB_OUTPUT"
|
||
|
||
- name: Publish
|
||
env:
|
||
REF_TYPE: ${{ github.ref_type }}
|
||
run: |
|
||
if [ "${REF_TYPE}" = "tag" ]; then
|
||
uv publish dist/*
|
||
else
|
||
uv publish --dry-run dist/*
|
||
fi
|
||
|
||
- name: Create PR for next patch version
|
||
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
||
if: github.ref_type == 'tag'
|
||
with:
|
||
branch: "gha/bump-ess-migration-tool-to-${{ steps.versions.outputs.next-version }}"
|
||
base: "main"
|
||
commit-message: "Bump ess-migration-tool version to ${{ steps.versions.outputs.next-version }}"
|
||
title: "Bump ess-migration-tool version to ${{ steps.versions.outputs.next-version }} after release"
|
||
labels: automated,version-bump
|
||
body: |
|
||
${{ steps.versions.outputs.this-version }} has just been released.
|
||
This PR prepares ess-migration-tool package for the next release:
|
||
${{ steps.versions.outputs.next-version }}.
|
||
|
||
The target branch may be wrong. In which case this PR should be taken over and manually adjusted.
|