-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from betaboon/migrate-to-copier-template
chore: migrate to copier-template
- Loading branch information
Showing
91 changed files
with
2,392 additions
and
1,507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Changes here will be overwritten by Copier | ||
_commit: 110754b | ||
_src_path: gh:betaboon/copier-python | ||
author_email: [email protected] | ||
author_name: betaboon | ||
copyright_holder: betaboon | ||
copyright_license: Apache-2.0 | ||
copyright_year: '2024' | ||
project_description: A EventstoreDB gRPC client written in python . | ||
project_name: EventstoreDB Client Python | ||
python_console_script: false | ||
python_import_name: eventstoredb | ||
python_package_name: eventstoredb | ||
python_versions: | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
repository_name: EventStoreDB-Client-Python | ||
repository_namespace: betaboon | ||
repository_provider: github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
export VIRTUAL_ENV=.venv | ||
layout python | ||
# vi: ft=sh | ||
|
||
# use nix shell if nix is available | ||
if command -v nix &> /dev/null; then | ||
use_nix | ||
fi | ||
|
||
# use venv if one exists | ||
if [ -d ".venv" ]; then | ||
export VIRTUAL_ENV=.venv | ||
layout python | ||
fi | ||
|
||
# load local config | ||
source_env_if_exists .envrc.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build docs | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
- name: Set up PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
cache: true | ||
- name: Install dependencies | ||
run: pdm sync -G :all | ||
- name: Run build | ||
run: pdm run docs-build | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs | ||
path: ${{ github.workspace }}/docs/_build | ||
retention-days: 1 | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: "Version of the package" | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
build: | ||
name: Build package | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
python-version: | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: true | ||
- name: Install dependencies | ||
run: pdm sync -G :all | ||
- name: Run build | ||
run: pdm build | ||
env: | ||
PDM_BUILD_SCM_VERSION: ${{ inputs.version }} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 # v4 has a bug: https://github.com/actions/upload-artifact/issues/506 | ||
with: | ||
name: package | ||
path: ${{ github.workspace }}/dist | ||
overwrite: true | ||
retention-days: 1 | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.event.number || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
uses: ./.github/workflows/lint.yaml | ||
secrets: inherit | ||
|
||
test: | ||
uses: ./.github/workflows/test.yaml | ||
secrets: inherit | ||
|
||
prepare-release: | ||
needs: | ||
- lint | ||
- test | ||
uses: ./.github/workflows/prepare-release.yaml | ||
secrets: inherit | ||
|
||
build-package: | ||
needs: | ||
- prepare-release | ||
if: needs.prepare-release.outputs.new-release == 'true' | ||
uses: ./.github/workflows/build-package.yaml | ||
secrets: inherit | ||
with: | ||
version: ${{ needs.prepare-release.outputs.version }} | ||
|
||
build-docs: | ||
needs: | ||
- prepare-release | ||
if: needs.prepare-release.outputs.new-release == 'true' | ||
uses: ./.github/workflows/build-docs.yaml | ||
secrets: inherit | ||
|
||
publish-pypi: | ||
needs: | ||
- build-package | ||
- build-docs | ||
uses: ./.github/workflows/publish-pypi.yaml | ||
secrets: inherit | ||
permissions: | ||
id-token: write | ||
|
||
publish-github: | ||
needs: | ||
- prepare-release | ||
- build-package | ||
- publish-pypi | ||
uses: ./.github/workflows/publish-github.yaml | ||
secrets: inherit | ||
permissions: | ||
contents: write | ||
with: | ||
version: ${{ needs.prepare-release.outputs.version }} | ||
changelog: ${{ needs.prepare-release.outputs.changelog }} | ||
|
||
publish-docs: | ||
needs: | ||
- build-docs | ||
- publish-pypi | ||
uses: ./.github/workflows/publish-docs.yaml | ||
secrets: inherit | ||
permissions: | ||
id-token: write | ||
pages: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: PR | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.event.number || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
uses: ./.github/workflows/lint.yaml | ||
secrets: inherit | ||
|
||
test: | ||
uses: ./.github/workflows/test.yaml | ||
secrets: inherit | ||
|
||
build-docs: | ||
uses: ./.github/workflows/build-docs.yaml | ||
secrets: inherit | ||
|
||
passed: | ||
needs: | ||
- lint | ||
- test | ||
- build-docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check lint status | ||
if: ${{ needs.lint.result != 'success' }} | ||
run: exit 1 | ||
- name: Check test status | ||
if: ${{ needs.test.result != 'success' }} | ||
run: exit 1 | ||
- name: Check build docs status | ||
if: ${{ needs.build-docs.result != 'success' }} | ||
run: exit 1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Lint | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint-code: | ||
name: Lint code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
- name: Set up PDM | ||
id: pdm | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
cache: true | ||
- name: Install dependencies | ||
run: pdm sync -G :all | ||
- name: Cache pre-commit dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ steps.pdm.outpus.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Run lint | ||
run: pdm run _ci-lint-code | ||
env: | ||
FROM_REF: origin/${{ github.event.repository.default_branch }} | ||
TO_REF: HEAD | ||
|
||
lint-commits: | ||
name: Lint commit messages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
- name: Set up PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
cache: true | ||
- name: Install dependencies | ||
run: pdm sync -G :all | ||
- name: Run lint-commits | ||
run: pdm run _ci-lint-commits | ||
env: | ||
FROM_REF: origin/${{ github.event.repository.default_branch }} | ||
TO_REF: HEAD | ||
|
||
passed: | ||
needs: | ||
- lint-code | ||
- lint-commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check lint code status | ||
if: ${{ needs.lint-code.result != 'success' }} | ||
run: exit 1 | ||
- name: Check lint commits status | ||
if: ${{ needs.lint-commits.result != 'success' }} | ||
run: exit 1 |
Oops, something went wrong.