Skip to content

Commit 7350410

Browse files
only_doc_pages (#13)
close #14
1 parent 046e042 commit 7350410

22 files changed

Lines changed: 248 additions & 75 deletions

.devcontainer/devcontainer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@
3131
"extensions": [
3232
"EditorConfig.EditorConfig",
3333
"GitHub.vscode-pull-request-github",
34-
"yzhang.markdown-all-in-one",
35-
"ms-vscode-remote.vscode-remote-extensionpack"
34+
"ms-vscode-remote.vscode-remote-extensionpack",
35+
"ms-vscode-remote.remote-containers",
36+
"ms-python.python",
37+
"ms-python.vscode-pylance",
38+
"ms-python.isort",
39+
"yzhang.markdown-all-in-one"
3640
]
3741
}
3842
}

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ indent_style = tab
1010
[*.{cmd,bat}]
1111
end_of_line = crlf
1212

13-
[*.{yml,yaml,md,pages}]
13+
[*.{yml,yaml,pages,md,markdown}]
1414
indent_style = space
1515
indent_size = 2
1616

1717
[*.py]
1818
indent_style = space
1919
indent_size = 4
20+
21+
[*.json]
22+
indent_size = 2

.file-filter.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
mkdocsignore: false
2-
include_glob:
3-
- 'test/test.md'
4-
- '**/draft-*.md'
5-
exclude_glob:
6-
- 'Contributions/**'
1+
# mkdocsignore: false
2+
# include_glob:
3+
# - "test/test.md"
4+
# - "**/draft-*.md"
5+
# exclude_glob:
6+
# - "Contributions/**"
7+
# include_tag:
8+
# - foo
9+
# - "#bar"
10+
# exclude_tag:
11+
# - test
12+
13+
only_doc_pages: true # default value is false
14+
exclude_regex:
15+
- '.*\.md$'
16+
include_regex:
17+
- "tags.md"
718
include_tag:
8-
- foo
9-
- '#bar'
10-
exclude_tag:
11-
- test
19+
- released

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[flake8]
22
max-line-length = 88
3+
exclude = .git,__pycache__,.tox,.eggs,*.egg,.venv

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Default reviewers/codeowners for all code changes
1+
# Default reviewers/codeowners for all code changes in the repository
22
* @DariuszPorowski
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
---
2-
name: Pull Request checker
2+
name: CI
33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
8+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
- ready_for_review
514
branches:
615
- main
16+
paths:
17+
- "mkdocs_file_filter_plugin/**"
718

819
# Allow one concurrent
920
concurrency:
@@ -12,6 +23,7 @@ concurrency:
1223

1324
jobs:
1425
lint:
26+
if: ${{ !github.event.pull_request.draft }}
1527
name: Lint
1628
runs-on: ubuntu-latest
1729
steps:
@@ -28,7 +40,7 @@ jobs:
2840
cache: "poetry"
2941

3042
- name: Install dependencies
31-
run: poetry install --only=dev
43+
run: poetry install --verbose --only=dev
3244

3345
- name: Check imports sort
3446
run: poetry run isort --check-only .
@@ -40,6 +52,7 @@ jobs:
4052
run: poetry run flake8 --count .
4153

4254
test:
55+
if: ${{ !github.event.pull_request.draft }}
4356
name: Test
4457
needs: lint
4558
strategy:
@@ -62,11 +75,11 @@ jobs:
6275
cache: "poetry"
6376

6477
- name: Install dependencies
65-
run: poetry install
78+
run: poetry install --verbose
6679

6780
- name: Test Build
6881
run: |
69-
poetry version
82+
poetry version --verbose
7083
poetry build --verbose
7184
7285
- name: Test MkDocs build

.github/workflows/workflow.release.yml

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
name: Release
33

44
on:
5-
release:
6-
types:
7-
- prereleased
8-
- released
9-
- published
5+
push:
6+
tags:
7+
- "v*.*.*"
8+
9+
permissions:
10+
contents: write
1011

1112
jobs:
12-
release:
13-
if: ${{ !github.event.release.prerelease && github.event.action == 'released' && github.repository_owner == 'DariuszPorowski' }}
13+
pypi-release:
14+
name: PyPI Release
1415
environment:
1516
name: PyPI
1617
url: "https://pypi.org/project/mkdocs-file-filter-plugin"
@@ -29,13 +30,44 @@ jobs:
2930
cache: "poetry"
3031

3132
- name: Install dependencies
32-
run: poetry install
33+
run: poetry install --verbose
3334

3435
- name: Set Version
3536
run: poetry version ${GITHUB_REF_NAME/v/}
3637

3738
- name: Build
38-
run: poetry build
39+
run: poetry build --verbose
40+
41+
- name: Publish to PyPI
42+
run: poetry publish --verbose --username=__token__ --password ${{ secrets.PYPI_API_TOKEN }}
43+
44+
- name: Upload Artifact
45+
uses: actions/upload-artifact@v3
46+
with:
47+
name: plugin
48+
path: |
49+
dist/*
50+
schema*.json
51+
52+
gh-release:
53+
name: GitHub Release
54+
needs: pypi-release
55+
environment:
56+
name: GitHub
57+
url: ${{ steps.gh-release.outputs.url }}
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Download Artifact
61+
uses: actions/download-artifact@v3
62+
with:
63+
name: plugin
64+
path: .
3965

40-
- name: Publish
41-
run: poetry publish --username=__token__ --password ${{ secrets.PYPI_API_TOKEN }}
66+
- name: Release
67+
id: gh-release
68+
uses: softprops/action-gh-release@v1
69+
with:
70+
generate_release_notes: true
71+
files: |
72+
dist/*
73+
schema*.json

.markdownlint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"ignore_front_matter": true,
33
"MD013": false
4-
}
4+
}

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ repos:
22
- repo: https://github.com/psf/black
33
rev: 23.1.0
44
hooks:
5-
- id: black
5+
- id: black
66
- repo: https://github.com/PyCQA/isort
77
rev: 5.12.0
88
hooks:
9-
- id: isort
9+
- id: isort
1010
- repo: https://github.com/pycqa/flake8
1111
rev: 6.0.0
1212
hooks:
13-
- id: flake8
13+
- id: flake8
1414
- repo: https://github.com/PyCQA/bandit
1515
rev: 1.7.4
1616
hooks:
17-
- id: bandit
17+
- id: bandit

.vscode/extensions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
6+
"EditorConfig.EditorConfig",
7+
"ms-vscode-remote.remote-containers",
8+
"ms-python.python",
9+
"ms-python.vscode-pylance",
10+
"ms-python.isort",
11+
"yzhang.markdown-all-in-one"
12+
]
13+
}

0 commit comments

Comments
 (0)