generated from nicebots-xyz/botkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 03fdf24
Showing
59 changed files
with
3,344 additions
and
0 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,7 @@ | ||
.github/ | ||
.gitignore | ||
config.example.yaml | ||
poetry.lock | ||
pyproject.toml | ||
readme.md | ||
renovate.json |
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,75 @@ | ||
#file: noinspection SpellCheckingInspection | ||
on: | ||
push: | ||
branches: [ "main", "dev" ] | ||
# Publish semver tags as releases. | ||
tags: [ 'v*.*.*' ] | ||
pull_request: | ||
branches: ["dev"] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
tests: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
cache: true | ||
- name: Install dependencies | ||
run: pdm install -d | ||
- name: Run linting check | ||
run: pdm run lint --check | ||
- name: Run tests | ||
run: pdm run tests | ||
- name: Export requirements | ||
run: pdm run export | ||
- name: Check for changes | ||
if: contains(github.actor, 'renovate[bot]') == false | ||
run: git diff --exit-code HEAD requirements.txt | ||
docker: | ||
needs: tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3.4.0 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v3.2.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata for | ||
id: meta | ||
uses: docker/metadata-action@v5.5.1 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=ref,event=tag | ||
type=sha | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6.3.0 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,42 @@ | ||
name: Build and Push Docker Image | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3.3.0 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v3.2.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5.5.1 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=ref,event=tag | ||
type=sha | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6.1.0 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,16 @@ | ||
name: Run Tests | ||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
cache: true | ||
- name: Install dependencies | ||
run: pdm install -d | ||
- name: Run linting check | ||
run: pdm run lint --check | ||
- name: Run tests | ||
run: pdm run tests |
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,39 @@ | ||
name: Update Dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' # Runs at 00:00 every Sunday | ||
workflow_dispatch: # Allows manual triggering | ||
|
||
jobs: | ||
update-dependencies: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup PDM | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
cache: true | ||
- name: Lock dependencies | ||
run: pdm lock | ||
- name: Export requirements | ||
run: pdm run export | ||
- name: Check for changes | ||
id: git-check | ||
run: | | ||
git diff --exit-code --quiet requirements.txt || echo "changed=true" >> $GITHUB_OUTPUT | ||
- name: Create Pull Request | ||
if: steps.git-check.outputs.changed == 'true' | ||
run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git checkout -b update-dependencies-${{ github.run_id }} | ||
git add requirements.txt pyproject.toml pdm.lock | ||
git commit -m "Update dependencies" | ||
git push origin update-dependencies-${{ github.run_id }} | ||
gh pr create --title "Update dependencies" --body "This PR updates the project dependencies. Please review the changes and merge if everything looks good." --base ${{ github.ref_name }} --head update-dependencies-${{ github.run_id }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.