Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ jobs:
# Fetch all history
fetch-depth: '0'

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Setup uv
uses: plone/meta/.github/actions/setup_uv@2.x
with:
python-version: ${{ env.python-version }}

- name: Check for presence of a Change Log fragment (only pull requests)
if: github.event_name == 'pull_request'
env:
BASE_BRANCH: ${{ github.base_ref }}
run: |
git fetch --no-tags origin ${BASE_BRANCH}
uvx towncrier check --compare-with origin/${{ env.BASE_BRANCH }} --config pyproject.toml --dir .
git fetch --no-tags origin ${{ github.base_ref }}
uvx towncrier check --compare-with origin/${{ github.base_ref }} --config pyproject.toml --dir .
150 changes: 0 additions & 150 deletions .github/workflows/ci.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: 'Compute Config variables'

on:
workflow_call:
inputs:
python-version:
required: false
type: string
default: "3.12"
plone-version:
required: false
type: string
default: "6.1.1"
outputs:
backend:
description: "Flag reporting if we should run the backend jobs"
value: ${{ jobs.config.outputs.backend }}
docs:
description: "Flag reporting if we should run the docs jobs"
value: ${{ jobs.config.outputs.docs }}
base-tag:
description: "Base tag to be used when creating container images"
value: ${{ jobs.config.outputs.base-tag }}
python-version:
description: "Python version to be used"
value: ${{ inputs.python-version }}
plone-version:
description: "Plone version to be used"
value: ${{ inputs.plone-version }}

jobs:
config:
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend }}
docs: ${{ steps.filter.outputs.docs }}
base-tag: ${{ steps.vars.outputs.BASE_TAG }}
plone-version: ${{ steps.vars.outputs.plone-version }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Compute several vars needed for the CI
id: vars
run: |
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "plone-version=${{ inputs.plone-version }}" >> $GITHUB_OUTPUT

- uses: dorny/paths-filter@v3.0.2
id: filter
with:
filters: |
backend:
- '**'
- '.github/workflows/config.yml'
- '.github/workflows/main.yml'
docs:
- '.readthedocs.yaml'
- 'docs/**'
- '.github/workflows/docs.yaml'

- name: Test vars
run: |
echo "base-tag: ${{ steps.vars.outputs.base-tag }}"
echo 'plone-version: ${{ steps.vars.outputs.plone-version }}'
echo 'event-name: ${{ github.event_name }}'
echo "ref-name: ${{ github.ref_name }}"
echo 'Paths - backend: ${{ steps.filter.outputs.backend }}'
echo 'Paths - docs: ${{ steps.filter.outputs.docs }}'
61 changes: 61 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI pas.plugins.authomatic

on:
push:

jobs:

config:
name: "Compute configuration values"
uses: ./.github/workflows/config.yml
lint:
name: "Lint codebase"
uses: plone/meta/.github/workflows/backend-lint.yml@2.x
needs:
- config
with:
python-version: ${{ needs.config.outputs.python-version }}
plone-version: ${{ needs.config.outputs.plone-version }}
test:
name: "Test codebase"
uses: plone/meta/.github/workflows/backend-pytest.yml@2.x
needs:
- config
strategy:
matrix:
python-version: ["3.13", "3.12", "3.11", "3.10"]
plone-version: ["6.1-latest", "6.0-latest"]
with:
python-version: ${{ matrix.python-version }}
plone-version: ${{ matrix.plone-version }}

coverage:
name: "Backend: Coverage"
uses: plone/meta/.github/workflows/backend-pytest-coverage.yml@2.x
needs:
- config
- test
with:
python-version: ${{ needs.config.outputs.python-version }}
plone-version: ${{ needs.config.outputs.plone-version }}

report:
name: "Final report"
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- config
- lint
- test
- coverage
steps:
- name: Report
shell: bash
run: |
echo '# Workflow Report' >> $GITHUB_STEP_SUMMARY
echo '| Job ID | Conclusion |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| Config | ${{ needs.config.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| Lint | ${{ needs.coverage.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| Test | ${{ needs.coverage.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| Coverage | ${{ needs.coverage.result }} |' >> $GITHUB_STEP_SUMMARY
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,13 @@ else
PLONE_VERSION := 6.1.1
endif

ifdef KEYCLOAK_VERSION
KEYCLOAK_VERSION := $(KEYCLOAK_VERSION)
else
KEYCLOAK_VERSION := 22.0.0
endif

VENV_FOLDER=$(BACKEND_FOLDER)/.venv
BIN_FOLDER=$(VENV_FOLDER)/bin
TESTS_FOLDER=$(BACKEND_FOLDER)/tests

# Environment variables to be exported
export PYTHONWARNINGS := ignore
export DOCKER_BUILDKIT := 1
export KEYCLOAK_VERSION := $(KEYCLOAK_VERSION)

all: build

Expand Down
37 changes: 7 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<div align="center"><img alt="logo" src="https://raw.githubusercontent.com/collective/pas.plugins.authomatic/main/docs/authomatic.svg" width="70" /></div>
<div align="center">

<img alt="logo" src="https://raw.githubusercontent.com/collective/pas.plugins.authomatic/main/docs/authomatic.svg" width="70" />
<h1 align="center">OAuth2 / OpenId Authentication in Plone</h1>

</div>

<div align="center">

[![PyPI](https://img.shields.io/pypi/v/pas.plugins.authomatic)](https://pypi.org/project/pas.plugins.authomatic/)
Expand All @@ -13,8 +16,7 @@

[![PyPI - Plone Versions](https://img.shields.io/pypi/frameworkversions/plone/pas.plugins.authomatic)](https://pypi.org/project/pas.plugins.authomatic/)

[![Code analysis checks](https://github.com/collective/pas.plugins.authomatic/actions/workflows/code-analysis.yml/badge.svg)](https://github.com/collective/pas.plugins.authomatic/actions/workflows/code-analysis.yml)
[![Tests](https://github.com/collective/pas.plugins.authomatic/actions/workflows/tests.yaml/badge.svg)](https://github.com/collective/pas.plugins.authomatic/actions/workflows/tests.yaml)
[![CI](https://github.com/collective/pas.plugins.authomatic/actions/workflows/main.yml/badge.svg)](https://github.com/collective/pas.plugins.authomatic/actions/workflows/main.yml)
![Code Style](https://img.shields.io/badge/Code%20Style-Black-000000)

[![GitHub contributors](https://img.shields.io/github/contributors/collective/pas.plugins.authomatic)](https://github.com/collective/pas.plugins.authomatic)
Expand Down Expand Up @@ -269,35 +271,10 @@ Towncrier will automatically add a reference to the issue when rendering the CHA

Releasing `pas.plugins.authomatic` is done using a combination of [zest.releaser](https://zestreleaser.readthedocs.io/) and [hatch](https://hatch.pypa.io/latest/).

The release process consists of three steps: **Pre-release**, **Release**, and **Post-release**.

#### Pre-release
Run the following command to populate the `CHANGES.md` file with the entries available in the `news/` directory:

```bash
.venv/bin/prerelease
```

#### Release

1. Create a new Git tag:
```bash
git tag -a {VERSION} -m "Release {VERSION}"
```
2. Build the project:
```bash
hatch build
```
3. Publish the package to PyPI:
```bash
hatch publish
```

#### Post-release
Run the following command to bump the package version, create a new commit, and push all changes to GitHub:
To release the package run:

```bash
.venv/bin/postrelease
make release
```

## License
Expand Down
1 change: 1 addition & 0 deletions news/+release.documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update README file with release instructions. @ericof
1 change: 1 addition & 0 deletions news/102.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GHA: Use plone/meta shared workflows. @ericof