diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..fd5d17d7a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "monthly" + timezone: "Asia/Tokyo" + groups: + dependencies: + patterns: + - "*" + target-branch: "main" + versioning-strategy: lockfile-only + + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "monthly" + timezone: "Asia/Tokyo" + target-branch: "main" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..e8172926f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: Lint + +on: [ push, pull_request ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install Poetry and pre-commit + run: | + pipx install poetry + pipx install pre-commit + - name: Install dependencies + run: poetry install --no-interaction + - name: Run pre-commit + run: poetry run pre-commit run --all-files diff --git a/.github/workflows/org.yml b/.github/workflows/org.yml new file mode 100644 index 000000000..624bb61cd --- /dev/null +++ b/.github/workflows/org.yml @@ -0,0 +1,30 @@ +name: Generate org files + +on: + push: + paths: + - "knp/**" + +jobs: + generate-org: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install Poetry + run: pipx install poetry + - name: Install dependencies + run: poetry install --no-interaction + - name: Generate org files + run: poetry run python scripts/knp_to_org.py + - name: Commit and push changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: update org files + # Optional glob pattern of files which should be added to the commit + file_pattern: org/**/*.org + # Optional. Prevents the shell from expanding filenames. + # Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html + disable_globbing: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..d3f5efb32 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + tag_name: ${{ github.ref_name }} + draft: false + prerelease: false diff --git a/.github/workflows/requirements.yml b/.github/workflows/requirements.yml new file mode 100644 index 000000000..c974a6783 --- /dev/null +++ b/.github/workflows/requirements.yml @@ -0,0 +1,33 @@ +name: Generate requirements.txt + +on: + push: + paths: + - "pyproject.toml" + - "poetry.lock" + +jobs: + generate-requirements: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install Poetry and poetry-plugin-export + run: | + pipx install poetry + pipx inject poetry poetry-plugin-export + - name: Add path for Python packages + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Export requirements.txt + run: poetry export --without-hashes --without-urls -o requirements.txt + - name: Commit and push changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: update requirements.txt + # Optional glob pattern of files which should be added to the commit + file_pattern: requirements.txt + # Optional. Prevents the shell from expanding filenames. + # Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html + disable_globbing: true