Skip to content

Commit

Permalink
feat(release): automate release via release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
totallyzen committed Feb 27, 2024
1 parent 098db15 commit 622d7e7
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 110 deletions.
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"
}
26 changes: 26 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: setup-env
description: set up the python environment

inputs:
python-version:
description: "The python version to install and use"
default: "3.9" # we default to the minimum python version for the project
required: false
auto-checkout:
description: "To perform the checkout or not. Might have done the checkout earlier"
default: "true"
required: false

runs:
using: composite
steps:
- uses: actions/checkout@v4
if: ${{ inputs.auto-checkout == "true" }}
- 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
9 changes: 9 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"release-type": "python",
"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.

8 changes: 3 additions & 5 deletions .github/workflows/ci-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ 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:
auto-checkout: false
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install Python dependencies
run: poetry install -E ${{ matrix.module }}
- name: Run tests
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ jobs:
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
10 changes: 2 additions & 8 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ jobs:
all:
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
with:
python-version: 3.9
cache: poetry
- name: Setup Env
uses: .github/actions/setup-env
- name: Install Python dependencies
run: poetry install
- name: Install pre-commit
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ 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
- 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
15 changes: 15 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Please

on:
push:
branches: [ main ]

jobs:
release:
runs-on: ubuntu-latest
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
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.

0 comments on commit 622d7e7

Please sign in to comment.