Skip to content

Commit c2cdf83

Browse files
committed
refactor: Incorporate 3.1.11 version of the common project template
Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
1 parent 826e4dd commit c2cdf83

24 files changed

+1500
-148
lines changed

.drone.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.editorconfig

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# http://EditorConfig.org
33
#
44
# This file is based on The Common EditorConfig Template project
5-
# https://github.com/Lin-Buo-Ren/the-common-editorconfig-template
5+
# https://github.com/the-common/editorconfig-template
66
#
7-
# Copyright 2021 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
7+
# Copyright 2021 林博仁(Buo-ren, Lin) <buo.ren.lin@gmail.com>
88
# SPDX-License-Identifier: WTFPL
99

1010
# This is the top-most EditorConfig file
@@ -19,6 +19,10 @@ charset = utf-8
1919
insert_final_newline = true
2020
trim_trailing_whitespace = true
2121

22+
# Git configuration files uses tabs as indentation units
23+
[/.git{modules,config}]
24+
indent_style = tab
25+
2226
# Avoid git patch fail to apply due to stripped unmodified lines that contains only spaces
2327
[/.git/**]
2428
trim_trailing_whitespace = false
@@ -37,6 +41,10 @@ trim_trailing_whitespace = false
3741
# Markdownlint to check instead
3842
indent_size = unset
3943

44+
[*.{diff,patch}]
45+
# Trailing whitespaces are unchanged lines in patch files
46+
trim_trailing_whitespace = false
47+
4048
# Vagrant configuration file
4149
[Vagrantfile]
4250
indent_size = 2
@@ -48,3 +56,11 @@ indent_size = 2
4856
# YAML documents
4957
[*.{yml,yaml}]
5058
indent_size = 2
59+
60+
[.*.{yml,yaml}]
61+
indent_size = 2
62+
63+
# Keep the indentation style of the license text verbatim
64+
[/LICENSES/*]
65+
indent_size = unset
66+
indent_style = unset

.gitattributes

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
# Git path attributes configuration file
22
#
3-
# Defining attributes per path
3+
# References:
44
#
5-
# Reference:
6-
# - Git - gitattributes Documentation
7-
# https://git-scm.com/docs/gitattributes
5+
# * Git - Git Attributes
6+
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
7+
# * Git - gitattributes Documentation
8+
# https://www.git-scm.com/docs/gitattributes
89
#
910
# This file is based on The Commons Gitattributes Templates
1011
# https://gitlab.com/brlin/the-commons-gitattributes-templates
1112
#
13+
# Copyright 2025 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
1214
# SPDX-License-Identifier: CC-BY-SA-4.0
13-
# Copyright © 2025 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
1415

15-
# Exclude development assets from source archive
16+
# Avoid exporting development files to release archive
1617
/.* export-ignore
18+
/continuous-integration export-ignore
19+
/docker-compose.yaml export-ignore
20+
21+
# Keep the product
1722
/.pre-commit-config.yaml -export-ignore
18-
/continuous-integration/ export-ignore
1923

2024
# Exclude development assets exclusive licenses
2125
/LICENSES/WTFPL.* export-ignore
26+
27+
# Keep editorconfig for ease of editing of product files
28+
/.editorconfig -export-ignore

.github/workflows/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# workflows
2+
3+
Workflow definition files of the [GitHub Actions Continuous Integration(CI) service](https://github.com/features/actions)
4+
5+
## Reference
6+
7+
* [Features • GitHub Actions](https://github.com/features/actions)
8+
Product page
9+
* [GitHub Actions Documentation - GitHub Docs](https://docs.github.com/en/actions)
10+
Official documentation
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# GitHub Actions workflow for checking potential problems in the project
2+
#
3+
# References:
4+
#
5+
# * Workflow syntax for GitHub Actions - GitHub Docs
6+
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
7+
#
8+
# Copyright 2024 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
9+
# SPDX-License-Identifier: CC-BY-SA-4.0
10+
name: Check potential problems in the project
11+
on:
12+
push:
13+
branches:
14+
- '**'
15+
jobs:
16+
check-using-precommit:
17+
name: Check potential problems using pre-commit
18+
runs-on: ubuntu-22.04
19+
env:
20+
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip
21+
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit
22+
SHELLCHECK_DIR: ${{ github.workspace }}/.cache/shellcheck-stable
23+
steps:
24+
- name: Check out content from the Git repository
25+
uses: actions/checkout@v4
26+
27+
- name: Configure PyPI data cache to speed up continuous integration
28+
uses: actions/cache@v4
29+
with:
30+
key: ${{ runner.os }}-pip
31+
path: ${{ env.PIP_CACHE_DIR }}
32+
33+
- name: >-
34+
Configure pre-commit data cache to speed up continuous integration
35+
uses: actions/cache@v4
36+
with:
37+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
38+
path: ${{ env.PRE_COMMIT_HOME }}
39+
40+
- name: >-
41+
Configure pre-built ShellCheck cache to speed up continuous integration
42+
uses: actions/cache@v4
43+
with:
44+
key: ${{ runner.os }}-${{ runner.arch }}-shellcheck
45+
path: ${{ env.SHELLCHECK_DIR }}
46+
47+
- name: >-
48+
Patch the sudo security policy so that programs run via sudo
49+
will recognize environment variables predefined by GitHub
50+
run: sudo ./continuous-integration/patch-github-actions-sudo-security-policy.sh
51+
52+
- name: Run the static analysis programs
53+
run: |
54+
sudo ./continuous-integration/do-static-analysis.install-system-deps.sh
55+
./continuous-integration/do-static-analysis.sh
56+
57+
- name: Send CI result notification to the Telegram channel
58+
uses: yanzay/notify-telegram@v0.1.0
59+
if: always()
60+
with:
61+
chat: '@the_common_ci_results'
62+
token: ${{ secrets.telegram_bot_api_token_ci }}
63+
status: ${{ job.status }}

.github/workflows/release.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Release product and their build aritfacts
2+
#
3+
# References:
4+
#
5+
# * Workflow syntax for GitHub Actions - GitHub Docs
6+
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
7+
#
8+
# Copyright 2024 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
9+
# SPDX-License-Identifier: CC-BY-SA-4.0
10+
name: Release product and their build aritfacts
11+
on:
12+
push:
13+
tags:
14+
- v*.*.*
15+
16+
jobs:
17+
release:
18+
name: Release product and their build aritfacts
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- name: Check out content from the Git repository
22+
uses: actions/checkout@v4
23+
with:
24+
# Increase fetch depth if you may have more than this amount
25+
# of revisions between releases
26+
fetch-depth: 100
27+
28+
# Fetch tags as well to generate detailed changes between two releases
29+
# WORKAROUND: Adding this option triggers actions/checkout#1467
30+
#fetch-tags: true
31+
32+
# Also recursively fetch submodules
33+
# WORKAROUND: Adding this option triggers actions/checkout#1959
34+
#submodules: true
35+
36+
- name: >-
37+
WORKAROUND: Fetch tags that points to the revisions
38+
checked-out(actions/checkout#1467)
39+
run: |-
40+
git fetch \
41+
--prune \
42+
--prune-tags \
43+
--force \
44+
--depth=100 \
45+
--no-recurse-submodules
46+
47+
- name: >-
48+
WORKAROUND: Checkout submodules recursively(actions/checkout#1959)
49+
run: |-
50+
git submodule update \
51+
--init \
52+
--recursive \
53+
--depth 1
54+
55+
- name: Determine the project identifier
56+
run: printf "project_id=${GITHUB_REPOSITORY##*/}\\n" >> $GITHUB_ENV
57+
58+
- name: Determine the name of the Git tag
59+
run: printf "release_tag=${GITHUB_REF##*/}\\n" >> $GITHUB_ENV
60+
61+
- name: Determine the release version string
62+
run: printf "release_version=${release_tag#v}\\n" >> $GITHUB_ENV
63+
64+
- name: Determine the release identifier
65+
run: printf "release_id=${project_id}-${release_version}\\n" >> $GITHUB_ENV
66+
67+
- name: >-
68+
Patch the sudo security policy so that programs run via sudo
69+
will recognize environment variables predefined by GitHub
70+
run: sudo ./continuous-integration/patch-github-actions-sudo-security-policy.sh
71+
72+
- name: Generate the release archive
73+
run: |-
74+
sudo ./continuous-integration/generate-build-artifacts.install-system-deps.sh
75+
./continuous-integration/generate-build-artifacts.sh
76+
77+
- name: Generate the release description
78+
run: ./continuous-integration/generate-release-description.sh
79+
80+
- name: Publish the release archive to the GitHub Releases
81+
uses: softprops/action-gh-release@v2
82+
with:
83+
name: ${{ env.project_id }} ${{ env.release_version }}
84+
files: |
85+
${{ env.release_id }}.tar*
86+
body_path: .detailed_changes

.gitignore

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Exclude files not suitable for version tracking in Git
55
#
66
# This file is based on The Common .gitignore Templates
7-
# https://github.com/Lin-Buo-Ren/common-gitignore
7+
# https://github.com/the-common/gitignore-templates
88
#
9-
# Copyright 2021 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
9+
# Copyright 2022 林博仁(Buo-ren, Lin) <buo.ren.lin@gmail.com>
1010
# SPDX-License-Identifier: CC-BY-SA-4.0
1111

1212
# Don't track regular Unix hidden files
@@ -31,10 +31,16 @@
3131
# https://docs.drone.io/
3232
!.drone.yml
3333

34+
# Do track yamllint configuration files
35+
!.yamllint
36+
3437
# Do track REUSE configuration files
3538
# https://reuse.software/
3639
!.reuse/
3740

41+
# Do track GitLab CI configuration file
42+
!/.gitlab-ci.yml
43+
3844
# Don't track common backup filename extensions
3945
*~
4046
*.bak*
@@ -73,3 +79,12 @@
7379

7480
# Don't track Vagrant runtime directories
7581
.vagrant/
82+
83+
# Don't track GNU gettext message catalog template
84+
*.pot
85+
86+
# Don't track GNU gettext machine-readable message catalogs
87+
*.mo
88+
89+
# Don't track continuous integration virtual environments
90+
/continuous-integration/venv/

0 commit comments

Comments
 (0)