Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(release): automate release via release-please #429

Merged
merged 10 commits into from
Feb 29, 2024
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "3.7.1"
}
20 changes: 20 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: setup-env
description: set up the python environment

inputs:
python-version:
description: "The python version to install and use"
default: "3.11" # we default to latest supported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... which is python 3.12: https://devguide.python.org/versions/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite! :)
https://github.com/testcontainers/testcontainers-python/blob/main/pyproject.toml#L58-L59

BUT, this is definitely a no-brainer follow up once we've rebooted! Thanks for reading! ❤️

Copy link
Contributor

@jankatins jankatins Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh fuuu... That should definitely be a <4.0 or even unbounded (I really dislike poetry in that regard, there are a lot of arguments that libraries should never use upper bounds in their own dependency spec).

Fun, we actually use testcontainers-python (or better all the "current" small packages) in a py3.12 project.

Really looking forward to get this rebooted and then a few of the "get rid of dependencies by looking at logs" PRs merged.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jankatins in the end it took no effort
a342b60

The project is running off of my and @alexanderankin 's excess energy.

Thanks for showing support, it adds a little extra energy to the mix, makes things easier.

required: false

runs:
using: composite
steps:
- name: Setup Poetry
run: pipx install poetry
shell: bash
- name: Setup python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: poetry
10 changes: 10 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"release-type": "python",
"bootstrap-sha": "28e3a471c32c1036dd5e37df13cdde3b1ba91000",
"packages": {
".": {
"package-name": "testcontainers"
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
30 changes: 0 additions & 30 deletions .github/workflows/attention-label.yml.disabled

This file was deleted.

7 changes: 2 additions & 5 deletions .github/workflows/ci-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ jobs:
gh run watch ${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Poetry
run: pipx install poetry
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up Python
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install Python dependencies
run: poetry install -E ${{ matrix.module }}
- name: Run tests
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ on:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu ]
python-version: ["3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: Setup Poetry
run: pipx install poetry
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Set up Python
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install Python dependencies
run: poetry install --all-extras
- name: Run twine check
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ on:
branches: [main]

jobs:
all:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Poetry
run: pipx install poetry
- name: Setup python 3.9
uses: actions/setup-python@v5
- name: Setup Env
uses: ./.github/actions/setup-env
with:
python-version: 3.9
cache: poetry
python-version: "3.9" # the pre-commit is hooked in as 3.9
- name: Install Python dependencies
run: poetry install
- name: Install pre-commit
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Poetry
run: pipx install poetry
- name: Setup python
uses: actions/setup-python@v5
- uses: actions/checkout@v4
- name: Set up Python
uses: ./.github/actions/setup-env
with:
python-version: "3.11"
cache: poetry
- name: Install Python dependencies
run: poetry install --all-extras
- name: Build documentation
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: lint-pr

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
validate:
name: validate-pull-request-title
runs-on: ubuntu-latest
steps:
- name: validate pull request title
uses: kontrolplane/pull-request-title-validator@ab2b54babb5337246f4b55cf8e0a1ecb0575e46d #v1
35 changes: 35 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release Please

on:
push:
branches: [ main ]

jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.track-release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: track-release
with:
manifest-file: .github/.release-please-manifest.json
config-file: .github/release-please-config.json
publish:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
needs:
- release
if: ${{ needs.release.outputs.release_created }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: ./.github/actions/setup-env
- name: build package
run: poetry build
# this action uploads packages from the `dist/` directory, which poetry has built in the previous step
# usable once we set up trusted publishing, see https://docs.pypi.org/trusted-publishers/using-a-publisher/
- name: push package
uses: pypa/gh-action-pypi-publish@release/v1
43 changes: 0 additions & 43 deletions .github/workflows/requirements.yml.disabled

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/triage-label.yml.disabled

This file was deleted.