Skip to content

Commit 6cfd3e9

Browse files
committed
chore: Initialize project
Signed-off-by: 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
1 parent e30d993 commit 6cfd3e9

30 files changed

+3209
-85
lines changed

.editorconfig

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# EditorConfig is awesome
2+
# http://EditorConfig.org
3+
#
4+
# This file is based on The Common EditorConfig Template project
5+
# https://github.com/the-common/editorconfig-template
6+
#
7+
# Copyright 2021 林博仁(Buo-ren, Lin) <buo.ren.lin@gmail.com>
8+
# SPDX-License-Identifier: WTFPL
9+
10+
# This is the top-most EditorConfig file
11+
root = true
12+
13+
# Common settings
14+
[*]
15+
end_of_line = lf
16+
indent_style = space
17+
indent_size = 4
18+
charset = utf-8
19+
insert_final_newline = true
20+
trim_trailing_whitespace = true
21+
22+
# Git configuration files uses tabs as indentation units
23+
[/.git{modules,config}]
24+
indent_style = tab
25+
26+
# Avoid git patch fail to apply due to stripped unmodified lines that contains only spaces
27+
[/.git/**]
28+
trim_trailing_whitespace = false
29+
30+
# Makefiles for *Make
31+
[{Makefile,*.mk}]
32+
indent_style = tab
33+
34+
# Markdown documents
35+
[*.{md,mkd,mkdn,markdown}]
36+
# Trailing whitespace means manual linebreaks
37+
trim_trailing_whitespace = false
38+
39+
# Don't check indentation size as it can't handle intentional indentation
40+
# in list item after hardbreaks to align with the node markers, use
41+
# Markdownlint to check instead
42+
indent_size = unset
43+
44+
[*.{diff,patch}]
45+
# Trailing whitespaces are unchanged lines in patch files
46+
trim_trailing_whitespace = false
47+
48+
# Vagrant configuration file
49+
[Vagrantfile]
50+
indent_size = 2
51+
52+
# yamllint configuration files
53+
[.yamllint]
54+
indent_size = 2
55+
56+
# YAML documents
57+
[*.{yml,yaml}]
58+
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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Git path attributes configuration file
2+
#
3+
# References:
4+
#
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
9+
#
10+
# Copyright 2024 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>
11+
# SPDX-License-Identifier: CC-BY-SA-4.0
12+
13+
# Avoid exporting development files to release archive
14+
/.* export-ignore
15+
/continuous-integration export-ignore
16+
/compose.yml export-ignore
17+
/dev-assets export-ignore
18+
/Vagrantfile export-ignore
19+
20+
# Keep editorconfig for ease of editing of product files
21+
/.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: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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|${{ runner.os }}|${{ 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+
# False positive: This step(and thus the entire workflow) will fail when the command returns a non-zero exit status
51+
# amazon-q-ignore-next-line
52+
run: sudo ./continuous-integration/patch-github-actions-sudo-security-policy.sh
53+
54+
- name: Run the static analysis programs
55+
run: |
56+
set -e
57+
sudo ./continuous-integration/do-static-analysis.install-system-deps.sh
58+
./continuous-integration/do-static-analysis.sh
59+
60+
- name: Send CI result notification to the Telegram channel
61+
uses: yanzay/notify-telegram@v0.1.0
62+
if: always()
63+
with:
64+
chat: ${{ vars.telegram_chat_id_ci }}
65+
token: ${{ secrets.telegram_bot_api_token_ci }}
66+
status: ${{ job.status }}

.github/workflows/release.yml

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

.gitignore

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Version Tracking Ignore Rules for Git VCS
2+
# https://git-scm.com/docs/gitignore
3+
#
4+
# Exclude files not suitable for version tracking in Git
5+
#
6+
# This file is based on The Common .gitignore Templates
7+
# https://github.com/the-common/gitignore-templates
8+
#
9+
# Copyright 2022 林博仁(Buo-ren, Lin) <buo.ren.lin@gmail.com>
10+
# SPDX-License-Identifier: CC-BY-SA-4.0
11+
12+
# Don't track regular Unix hidden files
13+
.*
14+
15+
# Do track Git configuration files
16+
!.git*
17+
18+
# Do track EditorConfig configuration files
19+
# https://editorconfig.org/
20+
!.editorconfig
21+
22+
# Do track pre-commit configuration files
23+
# https://pre-commit.com/
24+
!.pre-commit-config.yaml
25+
26+
# Do track Markdownlint configuration files
27+
# https://github.com/DavidAnson/markdownlint
28+
!.markdownlint.*
29+
30+
# Do track Drone CI configuration files
31+
# https://docs.drone.io/
32+
!.drone.yml
33+
34+
# Do track yamllint configuration files
35+
!.yamllint
36+
37+
# Do track REUSE configuration files
38+
# https://reuse.software/
39+
!.reuse/
40+
41+
# Do track GitLab CI configuration file
42+
!/.gitlab-ci.yml
43+
44+
# Do track ShellCheck configuration file
45+
!/.shellcheckrc
46+
47+
# Don't track common backup filename extensions
48+
*~
49+
*.bak*
50+
*.backup*
51+
*.bk*
52+
*.old*
53+
*.orig*
54+
55+
## Don't track common archive files
56+
*.7z
57+
*.bz2
58+
*.gz
59+
*.tar*
60+
*.xz
61+
*.zip
62+
63+
# Don't track binary image files
64+
*.bmp
65+
*.jpg
66+
*.png
67+
68+
# Don't track common export formats from Markdown
69+
*.doc?
70+
*.htm?
71+
*.pdf
72+
73+
# Don't track common program output logs
74+
*.err
75+
*.error
76+
*.log
77+
*.out
78+
*.output
79+
80+
# Don't track compiled Python code caches
81+
*.pyc
82+
83+
# Don't track Vagrant runtime directories
84+
.vagrant/
85+
86+
# Don't track GNU gettext message catalog template
87+
*.pot
88+
89+
# Don't track GNU gettext machine-readable message catalogs
90+
*.mo
91+
92+
# Don't track continuous integration virtual environments
93+
/continuous-integration/venv/
94+
95+
# Don't track unpacked product files
96+
/project-template-*/

0 commit comments

Comments
 (0)