-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Incorporate 2.1.10 version of The Common Project Template
Signed-off-by: 林博仁(Buo-ren, Lin) <[email protected]>
- Loading branch information
Showing
23 changed files
with
1,526 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# http://EditorConfig.org | ||
# | ||
# This file is based on The Common EditorConfig Template project | ||
# https://github.com/Lin-Buo-Ren/the-common-editorconfig-template | ||
# https://github.com/the-common/editorconfig-template | ||
# | ||
# Copyright 2021 林博仁(Buo-ren, Lin) <[email protected]> | ||
# SPDX-License-Identifier: WTFPL | ||
|
@@ -19,6 +19,10 @@ charset = utf-8 | |
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
# Git configuration files uses tabs as indentation units | ||
[/.git{modules,config}] | ||
indent_style = tab | ||
|
||
# Avoid git patch fail to apply due to stripped unmodified lines that contains only spaces | ||
[/.git/**] | ||
trim_trailing_whitespace = false | ||
|
@@ -37,6 +41,10 @@ trim_trailing_whitespace = false | |
# Markdownlint to check instead | ||
indent_size = unset | ||
|
||
[*.{diff,patch}] | ||
# Trailing whitespaces are unchanged lines in patch files | ||
trim_trailing_whitespace = false | ||
|
||
# Vagrant configuration file | ||
[Vagrantfile] | ||
indent_size = 2 | ||
|
@@ -48,3 +56,11 @@ indent_size = 2 | |
# YAML documents | ||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
[.*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
# Keep the indentation style of the license text verbatim | ||
[/LICENSES/*] | ||
indent_size = unset | ||
indent_style = unset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
# Git path attributes configuration file | ||
# | ||
# Defining attributes per path | ||
# References: | ||
# | ||
# Reference: | ||
# - Git - gitattributes Documentation | ||
# https://git-scm.com/docs/gitattributes | ||
# * Git - Git Attributes | ||
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes | ||
# * Git - gitattributes Documentation | ||
# https://www.git-scm.com/docs/gitattributes | ||
# | ||
# This file is based on The Commons Gitattributes Templates | ||
# https://gitlab.com/brlin/the-commons-gitattributes-templates | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 | ||
# Copyright © 2021 林博仁(Buo-ren, Lin) <[email protected]> | ||
# Copyright 2023 林博仁(Buo-ren, Lin) <[email protected]> | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 OR LicenseRef-Apache-2.0-If-Not-Used-In-Template-Projects | ||
|
||
# Exclude development assets from release archive | ||
# Avoid exporting development files to release archive | ||
/.* export-ignore | ||
/continuous-integration/ export-ignore | ||
/continuous-integration export-ignore | ||
|
||
# Exclude development assets exclusive licenses | ||
/LICENSES/WTFPL.* export-ignore | ||
# Keep editorconfig for ease of editing of product files | ||
/.editorconfig -export-ignore | ||
|
||
# Include dep5 declaration file in release archive | ||
# Keep REUSE DEP5 declaration file in the release archive for legal | ||
# conformance | ||
/.reuse/ -export-ignore | ||
/.reuse/* export-ignore | ||
/.reuse/dep5 -export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# workflows | ||
|
||
Workflow definition files of the [GitHub Actions Continuous Integration(CI) service](https://github.com/features/actions) | ||
|
||
## Reference | ||
|
||
* [Features • GitHub Actions](https://github.com/features/actions) | ||
Product page | ||
* [GitHub Actions Documentation - GitHub Docs](https://docs.github.com/en/actions) | ||
Official documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# GitHub Actions workflow for checking potential problems in the project | ||
# | ||
# References: | ||
# | ||
# * Workflow syntax for GitHub Actions - GitHub Docs | ||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | ||
# | ||
# Copyright 2022 林博仁(Buo-ren, Lin) <[email protected]> | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 | ||
name: Check potential problems in the project | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
jobs: | ||
check-using-precommit: | ||
name: Check potential problems using pre-commit | ||
runs-on: ubuntu-22.04 | ||
env: | ||
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip | ||
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit | ||
SHELLCHECK_DIR: ${{ github.workspace }}/.cache/shellcheck-stable | ||
steps: | ||
- name: Check out content from the Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure PyPI data cache to speed up continuous integration | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-pip | ||
path: ${{ env.PIP_CACHE_DIR }} | ||
|
||
- name: >- | ||
Configure pre-commit data cache to speed up continuous integration | ||
uses: actions/cache@v3 | ||
with: | ||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
- name: >- | ||
Configure pre-built ShellCheck cache to speed up continuous integration | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-${{ runner.arch }}-shellcheck | ||
path: ${{ env.SHELLCHECK_DIR }} | ||
- name: >- | ||
Patch the sudo security policy so that programs run via sudo | ||
will recognize environment variables predefined by GitHub | ||
run: sudo ./continuous-integration/patch-github-actions-sudo-security-policy.sh | ||
- name: Run the static analysis programs | ||
run: | | ||
sudo ./continuous-integration/do-static-analysis.install-system-deps.sh | ||
./continuous-integration/do-static-analysis.sh | ||
- name: Send CI result notification to the Telegram channel | ||
uses: yanzay/[email protected] | ||
if: always() | ||
with: | ||
chat: '@the_common_ci_results' | ||
token: ${{ secrets.telegram_bot_api_token_ci }} | ||
status: ${{ job.status }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Release product and their build aritfacts | ||
# | ||
# References: | ||
# | ||
# * Workflow syntax for GitHub Actions - GitHub Docs | ||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | ||
# | ||
# Copyright 2023 林博仁(Buo-ren, Lin) <[email protected]> | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 | ||
name: Release product and their build aritfacts | ||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
jobs: | ||
release: | ||
name: Release product and their build aritfacts | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out content from the Git repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# Increase fetch depth if you may have more than this amount | ||
# of revisions between releases | ||
fetch-depth: 100 | ||
|
||
# Fetch tags as well to generate detailed changes between two releases | ||
# WORKAROUND: Adding this option triggers actions/checkout#1467 | ||
#fetch-tags: true | ||
|
||
- name: >- | ||
WORKAROUND: Fetch tags that points to the revisions | ||
checked-out(actions/checkout#1467) | ||
run: |- | ||
git fetch \ | ||
--prune \ | ||
--prune-tags \ | ||
--force \ | ||
--depth=100 \ | ||
--no-recurse-submodules | ||
- name: Determine the project identifier | ||
run: printf "project_id=${GITHUB_REPOSITORY##*/}\\n" >> $GITHUB_ENV | ||
|
||
- name: Determine the name of the Git tag | ||
run: printf "release_tag=${GITHUB_REF##*/}\\n" >> $GITHUB_ENV | ||
|
||
- name: Determine the release version string | ||
run: printf "release_version=${release_tag#v}\\n" >> $GITHUB_ENV | ||
|
||
- name: Determine the release identifier | ||
run: printf "release_id=${project_id}-${release_version}\\n" >> $GITHUB_ENV | ||
|
||
- name: >- | ||
Patch the sudo security policy so that programs run via sudo | ||
will recognize environment variables predefined by GitHub | ||
run: sudo ./continuous-integration/patch-github-actions-sudo-security-policy.sh | ||
- name: Generate the release archive | ||
run: |- | ||
sudo ./continuous-integration/generate-build-artifacts.install-system-deps.sh | ||
./continuous-integration/generate-build-artifacts.sh | ||
- name: Generate the release description | ||
run: ./continuous-integration/generate-release-description.sh | ||
|
||
- name: Publish the release archive to the GitHub Releases | ||
uses: softprops/[email protected] | ||
with: | ||
name: ${{ env.project_id }} ${{ env.release_version }} | ||
files: | | ||
${{ env.release_id }}.tar* | ||
body_path: .detailed_changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,10 @@ | |
# Exclude files not suitable for version tracking in Git | ||
# | ||
# This file is based on The Common .gitignore Templates | ||
# https://github.com/Lin-Buo-Ren/common-gitignore | ||
# Copyright 2021 林博仁(Buo-ren, Lin) <[email protected]> | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 | ||
# https://github.com/the-common/gitignore-templates | ||
# | ||
# Copyright 2022 林博仁(Buo-ren, Lin) <[email protected]> | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 OR LicenseRef-Apache-2.0-If-Not-Used-In-Template-Projects | ||
|
||
# Don't track regular Unix hidden files | ||
.* | ||
|
@@ -30,19 +31,22 @@ | |
# https://docs.drone.io/ | ||
!.drone.yml | ||
|
||
# Do track yamllint configuration files | ||
!.yamllint | ||
|
||
# Do track REUSE configuration files | ||
# https://reuse.software/ | ||
!.reuse/ | ||
|
||
# Do track yamllint configuration files | ||
!.yamllint | ||
# Do track GitLab CI configuration file | ||
!/.gitlab-ci.yml | ||
|
||
# Don't track common backup filename extensions | ||
*~ | ||
*.bk* | ||
*.bak* | ||
*.backup* | ||
*.old* | ||
*.bk* | ||
*.old* | ||
*.orig* | ||
|
||
## Don't track common archive files | ||
|
@@ -60,18 +64,27 @@ | |
|
||
# Don't track common export formats from Markdown | ||
*.doc? | ||
*.htm? | ||
|
||
# Don't track common program output logs | ||
*.err | ||
*.error | ||
*.log | ||
*.out | ||
*.output | ||
*.err | ||
*.error | ||
|
||
# Don't track compiled Python code caches | ||
*.pyc | ||
|
||
# Don't track Vagrant runtime directories | ||
.vagrant/ | ||
|
||
# Don't track GNU gettext message catalog template | ||
*.pot | ||
|
||
# Don't track GNU gettext machine-readable message catalogs | ||
*.mo | ||
|
||
# Don't track continuous integration virtual environments | ||
/continuous-integration/venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# GitLab CI configuration file | ||
# | ||
# References: | ||
# | ||
# * `.gitlab-ci.yml` keyword reference | GitLab | ||
# https://docs.gitlab.com/ee/ci/yaml/ | ||
# | ||
# Copyright 2023 林博仁(Buo-ren, Lin) <[email protected]> | ||
# SPDX-License-Identifier: CC-BY-SA-4.0 OR LicenseRef-Apache-2.0-If-Not-Used-In-Template-Projects | ||
do-static-analysis: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_TAG == null | ||
needs: [] | ||
image: ubuntu:22.04 | ||
variables: | ||
PIP_CACHE_DIR: ${CI_PROJECT_DIR}/.cache/pip | ||
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit | ||
SHELLCHECK_DIR: ${CI_PROJECT_DIR}/.cache/shellcheck-stable | ||
cache: | ||
# Enable per-job and per-branch caching | ||
key: $CI_JOB_NAME-$CI_COMMIT_REF_SLUG | ||
paths: | ||
- ${PIP_CACHE_DIR} | ||
- ${PRE_COMMIT_HOME} | ||
- ${SHELLCHECK_DIR} | ||
|
||
script: | ||
- ./continuous-integration/do-static-analysis.install-system-deps.sh | ||
- ./continuous-integration/do-static-analysis.sh | ||
|
||
generate-build-artifacts: | ||
stage: build | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
needs: [] | ||
image: ubuntu:22.04 | ||
artifacts: | ||
paths: | ||
- ${CI_PROJECT_NAME}-*.tar* | ||
script: | ||
- ./continuous-integration/generate-build-artifacts.install-system-deps.sh | ||
- ./continuous-integration/generate-build-artifacts.sh | ||
|
||
upload-release-assets: | ||
stage: deploy | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
needs: | ||
- generate-build-artifacts | ||
image: curlimages/curl:latest | ||
script: | ||
- ./continuous-integration/upload-gitlab-generic-packages.sh | ||
|
||
create-release: | ||
stage: deploy | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
needs: | ||
- generate-build-artifacts | ||
- upload-release-assets | ||
image: registry.gitlab.com/gitlab-org/release-cli:latest | ||
script: | ||
- apk add bash git | ||
- ./continuous-integration/generate-release-description.sh | ||
- ./continuous-integration/create-gitlab-release.sh |
Oops, something went wrong.