-
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
1 parent
80e728b
commit 7c5a1e1
Showing
7 changed files
with
234 additions
and
28 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 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
groups: | ||
dependencies: | ||
patterns: | ||
- "*" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
groups: | ||
dependencies: | ||
patterns: | ||
- "*" | ||
open-pull-requests-limit: 10 |
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
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,51 @@ | ||
name: Update pre-commit Hooks | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * 5" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT_FOR_PUSHES }} | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.13" | ||
- name: Install poetry | ||
run: pip install poetry | ||
- name: Cache dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cache/pypoetry | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies | ||
run: poetry install | ||
|
||
# Update pre-commit hooks and check for changes | ||
- name: Update pre-commit hooks | ||
id: update_hooks | ||
run: | | ||
poetry run pre-commit autoupdate | ||
if git diff --exit-code .pre-commit-config.yaml; then | ||
echo "has_updates=false" >> "$GITHUB_OUTPUT" | ||
echo "No updates to pre-commit hooks. Exiting workflow." | ||
else | ||
echo "has_updates=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
# Commit/push | ||
- name: Commit changes | ||
if: steps.update_hooks.outputs.has_updates == 'true' | ||
shell: bash | ||
run: | | ||
git config --local user.email "33836132+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add .pre-commit-config.yaml | ||
git commit -m ":arrow_up: Update pre-commit hooks [skip ci]" || echo "No changes to commit" | ||
git push |
42 changes: 42 additions & 0 deletions
42
.github/workflows/update_requirements_after_dependabot.yml
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: Update Requirements after Dependabot Merge | ||
|
||
# ワークフローの処理の流れ: | ||
# 1. トリガー条件: | ||
# - プルリクエストマージ時 | ||
# - Dependabotによる実行であること | ||
# 2. 環境のセットアップ(Ubuntu、Python、Poetry) | ||
# 3. requirements.txtとrequirements-dev.txtの作成 | ||
# 4. 変更のコミットとプッシュ | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
update-requirements: | ||
if: github.event.pull_request.merged == true && github.event.pull_request.user.login == 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT_FOR_PUSHES }} | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.13" | ||
- name: Install Poetry | ||
run: pip install poetry | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Update requirements files | ||
run: | | ||
poetry export -f requirements.txt -o requirements.txt --without-hashes | ||
poetry export -f requirements.txt -o requirements-dev.txt --without-hashes --with dev | ||
- name: Commit and push changes | ||
run: | | ||
git config --local user.email "33836132+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add requirements.txt requirements-dev.txt | ||
git commit -m ":wrench:Update requirements files after dependency update [skip ci]" || echo "No changes to commit" | ||
git push |
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,87 @@ | ||
name: Version Update and Release | ||
|
||
# Workflow Process Flow: | ||
# 1. Trigger Conditions: | ||
# - Manual execution (workflow_dispatch) | ||
# 2. Environment Setup (Ubuntu, Python, Poetry) | ||
# 3. Retrieve the current version | ||
# 4. Update to the new version (patch, minor, or major) | ||
# 5. Commit and push the changes | ||
# 6. Create and push a new tag | ||
# 7. Generate the changelog | ||
# 8. Create a GitHub release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
update_type: | ||
description: "Type of version update" | ||
required: true | ||
default: "patch" | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
update-version-and-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT_FOR_PUSHES }} | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.13" | ||
- name: Install poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
- name: Configure Git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
- name: Get current version | ||
id: current_version | ||
run: echo "version=$(poetry version -s)" >> "$GITHUB_OUTPUT" | ||
- name: Update version | ||
id: update_version | ||
run: | | ||
poetry version ${{ github.event.inputs.update_type }} | ||
echo "new_version=$(poetry version -s)" >> "$GITHUB_OUTPUT" | ||
- name: Commit and push if changed | ||
run: | | ||
git add pyproject.toml | ||
git commit -m ":wrench:Bump version to ${{ steps.update_version.outputs.new_version }}" || echo "No changes to commit" | ||
git push | ||
- name: Create and push new tag | ||
run: | | ||
git tag v${{ steps.update_version.outputs.new_version }} | ||
git push --tags | ||
- name: Generate changelog | ||
id: changelog | ||
run: | | ||
changelog=$(git log --pretty=format:"- %s" v${{ steps.current_version.outputs.version }}..v${{ steps.update_version.outputs.new_version }}) | ||
{ | ||
echo "changelog<<EOF" | ||
echo "$changelog" | ||
echo "EOF" | ||
} >> "$GITHUB_OUTPUT" | ||
- name: Create Release | ||
uses: softprops/[email protected] | ||
with: | ||
tag_name: v${{ steps.update_version.outputs.new_version }} | ||
name: repo-dispatch-event-sender-v${{ steps.update_version.outputs.new_version }} | ||
body: | | ||
## Changes in this Release | ||
${{ steps.changelog.outputs.changelog }} | ||
For full changes, see the [comparison view](${{ github.server_url }}/${{ github.repository }}/compare/v${{ steps.current_version.outputs.version }}..v${{ steps.update_version.outputs.new_version }}) | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT_FOR_PUSHES }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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