Skip to content

Commit

Permalink
github actions?
Browse files Browse the repository at this point in the history
  • Loading branch information
gieljnssns committed Mar 28, 2024
1 parent a309025 commit 987eaab
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: weekly
26 changes: 26 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
change-template: '- #$NUMBER - $TITLE (@$AUTHOR)'
categories:
- title: "⚠ Breaking Changes"
labels:
- 'breaking-change'
- title: '⬆️ Dependencies'
collapse-after: 1
labels:
- 'dependencies'
- 'ci'
template: |
## What’s Changed
$CHANGES
version-resolver:
major:
labels:
- 'breaking-change'
minor:
labels:
- 'new-feature'
- 'new-provider'
- 'refactor'
default: patch
12 changes: 12 additions & 0 deletions .github/workflows/auto_approve_dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Auto approve Dependabot PR's

on: pull_request_target

jobs:
auto-approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.actor == 'dependabot[bot]'
steps:
- uses: hmarr/auto-approve-action@v4
23 changes: 23 additions & 0 deletions .github/workflows/pr-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: PR Labels

# yamllint disable-line rule:truthy
on:
pull_request:
types:
- synchronize
- labeled
- unlabeled
branches:
- main

jobs:
pr_labels:
name: Verify
runs-on: ubuntu-latest
steps:
- name: 🏷 Verify PR has a valid label
uses: ludeeus/[email protected]
with:
labels: >-
breaking-change, bugfix, refactor, new-feature, maintenance, ci, dependencies
45 changes: 45 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish releases to PyPI

on:
release:
types: [published, prereleased]

jobs:
build-and-publish-pypi:
name: Builds and publishes releases to PyPI
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.tag }}
steps:
- uses: actions/checkout@v4
- name: Get tag
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10"
- name: Install build
run: >-
pip install build tomli tomli-w
- name: Set Python project version from tag
shell: python
run: |-
import tomli
import tomli_w
with open("pyproject.toml", "rb") as f:
pyproject = tomli.load(f)
pyproject["project"]["version"] = "${{ steps.vars.outputs.tag }}"
with open("pyproject.toml", "wb") as f:
tomli_w.dump(pyproject, f)
- name: Build
run: >-
python3 -m build
- name: Publish release to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Drafter

on:
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will install Python dependencies, run tests and lint
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test with Pre-commit

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
continue-on-error: true

steps:
- name: Check out code from GitHub
uses: actions/checkout@v4
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip build setuptools
pip install . .[test]
- name: Lint/test with pre-commit
run: pre-commit run --all-files

0 comments on commit 987eaab

Please sign in to comment.