Skip to content

Commit

Permalink
add github actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-g committed Dec 8, 2023
1 parent df507ff commit 7763f26
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions .github/workflows/org.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions .github/workflows/requirements.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7763f26

Please sign in to comment.