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
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build

on:
workflow_call:
workflow_dispatch:

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
test:
uses: ./.github/workflows/test.yml
permissions:
contents: read

build:
name: Build distribution
runs-on: ubuntu-latest
needs:
- test

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

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Hatch
run: pipx install hatch

- name: Set package version from tag
run: hatch version "$(git describe --tags --always)"

- name: Build package
run: hatch build

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

sign-release:
name: Sign Python distribution with Sigstore
needs:
- build
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Sign distributions with Sigstore
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl

- name: Store signed distribution artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
overwrite: true
33 changes: 0 additions & 33 deletions .github/workflows/code_quality.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/deploy.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Prepare release

on:
push:
tags:
- "*"
workflow_call:
workflow_dispatch:

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
build:
uses: ./.github/workflows/build.yml
permissions:
contents: read
id-token: write

create-release:
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate release notes
id: release-notes
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip all
env:
OUTPUT: RELEASE_NOTES.md
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Create draft release
id: create-draft-release
uses: softprops/action-gh-release@v2
with:
files: |
./dist/*
draft: true
body_path: RELEASE_NOTES.md

- name: Summary
run: |
echo "# Release summary" >> "$GITHUB_STEP_SUMMARY"
echo "Url: ${{ steps.create-draft-release.outputs.url }}" >> "$GITHUB_STEP_SUMMARY"
echo "You can now publish the release on GitHub" >> "$GITHUB_STEP_SUMMARY"
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish

on:
release:
types:
- published
workflow_call:
workflow_dispatch:

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
publish-to-pypi:
name: Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ariadne-lambda
permissions:
id-token: write
contents: read

steps:
- name: Download all distributions from release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
'${{ github.ref_name }}'
-p '*.whl'
-p '*.tar.gz'
--dir dist/
--repo '${{ github.repository }}'

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
36 changes: 0 additions & 36 deletions .github/workflows/run_tests.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests

on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 7 * * 1,3"
workflow_call:
workflow_dispatch:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc

- name: Run static analysis
run: hatch run lint

- name: Run tests
run: hatch test -c -py ${{ matrix.python-version }}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# CHANGELOG

All notable unreleased changes to this project will be documented in this file.

For released versions, see the [Releases](https://github.com/mirumee/ariadne-lambda/releases) page.

## Unreleased

### 🛠️ Build System
- Modernize packaging metadata and CI/release workflows


1 change: 1 addition & 0 deletions ariadne_lambda/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.1.dev0" # This is overwritten by Hatch in CI/CD, don't change it.
2 changes: 1 addition & 1 deletion ariadne_lambda/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class GraphQLLambdaHandler(GraphQLHandler):
@abstractmethod
async def handle(self, event: dict, context: LambdaContext):
async def handle(self, event: dict, context: LambdaContext): # ty: ignore[invalid-method-override]
"""An entrypoint for the AWS Lambda connection handler.

This method is called by Ariadne AWS Lambda GraphQL application. Subclasses
Expand Down
Loading
Loading