Skip to content

Commit 7f8c089

Browse files
authored
Initial commit
0 parents  commit 7f8c089

33 files changed

+2908
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# =================================================================================================
2+
#
3+
# Set project related environment variables. Those are available for convenience
4+
# and are also required by 'norlab-shell-script-tools' library.
5+
#
6+
# Usage:
7+
#
8+
# Important! Source this file from 'libnabo' repository root
9+
# $ cd <path/to/libnabo/>
10+
# $ set -o allexport && source .env.libnabo && set +o allexport
11+
#
12+
# =================================================================================================
13+
14+
PROJECT_PROMPT_NAME='Norlab-Project-Template'
15+
#NBS_SPLASH_NAME=${NBS_SPLASH_NAME:-"${PROJECT_PROMPT_NAME}-build-system"}
16+
17+
# ....Programaticaly fetch source code information.................................................
18+
PROJECT_GIT_REMOTE_URL=$( git remote get-url origin )
19+
PROJECT_GIT_NAME=$( basename "${PROJECT_GIT_REMOTE_URL}" .git )
20+
PROJECT_PATH=$( git rev-parse --show-toplevel )
21+
PROJECT_SRC_NAME="$( basename ${PROJECT_PATH} )"
22+
23+
# ....Set project related environment variable with their own prefix...............................
24+
# Note: Those with "PROJECT_" prefix will get eventualy overiden in the case where N2ST is used
25+
# as a library. Using generic testing logic require that environment variables with
26+
# "PROJECT_" prefix be available.
27+
PLACEHOLDER_PROMPT_NAME="${PROJECT_PROMPT_NAME}"
28+
PLACEHOLDER_GIT_REMOTE_URL="${PROJECT_GIT_REMOTE_URL}"
29+
PLACEHOLDER_GIT_NAME="${PROJECT_GIT_NAME}"
30+
PLACEHOLDER_PATH="${PROJECT_PATH}"
31+
PLACEHOLDER_SRC_NAME="${PROJECT_SRC_NAME}"
32+
33+
# ....Set dependencies path........................................................................
34+
N2ST_PATH=${PROJECT_PATH}/utilities/norlab-shell-script-tools
35+
#NBS_PATH=${PROJECT_PATH}/utilities/norlab-build-system

.github/CODEOWNERS

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# =================================================================================================
2+
# Files or directories with designated code owner.
3+
#
4+
# Note:
5+
# - Each line is a file pattern followed by one or more owners.
6+
# - Branch with branch protection rule "Require review from Code Owners"
7+
# will automaticaly trigger a request to a designated code owner
8+
#
9+
# Reference: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
10+
#
11+
# =================================================================================================
12+
13+
# ....Repository wide code owner...................................................................
14+
# These owners will be the default owners for everything in the repo.
15+
#* @RedLeader962
16+
17+
# ....Core directories and files...................................................................
18+
#/src/ @RedLeader962
19+
#/tests/ @RedLeader962
20+
#/README.md @RedLeader962
21+
#/.env* @RedLeader962
22+
23+
# ....DevOps related...............................................................................
24+
#/.github/ @RedLeader962
25+
#/build_system/ @RedLeader962
26+
#/.gitignore @RedLeader962
27+
#/.gitmodules @RedLeader962
28+
#/.dockerignore @RedLeader962

.github/pull_request_template.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Description
2+
Add a quick summary here.
3+
4+
5+
6+
# Checklist:
7+
8+
### Code related
9+
- [ ] I have made corresponding changes to the documentation (i.e.: function/class, script header, README.md)
10+
- [ ] I have commented hard-to-understand code
11+
- [ ] I have added tests that prove my fix is effective or that my feature works
12+
- [ ] All tests pass locally with my changes (Check `tests/README.md` for local testing procedure)
13+
- [ ] My commit messages follow the [conventional commits](https://www.conventionalcommits.org) specification. See `commit_msg_reference.md` in the repository root for details
14+
15+
### PR creation related
16+
- [ ] My pull request `base ref` branch is set to the `dev` branch (the _build-system_ won't be triggered otherwise)
17+
- [ ] My pull request branch is up-to-date with the `dev` branch (the _build-system_ will reject it otherwise)
18+
19+
## Note for repository admins
20+
### Release PR related
21+
- Only repository admins have the privilege to `push/merge` on the default branch (ie: `main`) and the `release` branch.
22+
- Keep PR in `draft` mode until all the release reviewers are ready to push the release.
23+
- Once a PR from `release` -> `main` branch is created (not in draft mode), it triggers the _build-system_ test
24+
- On merge to the `main` branch, it triggers the _semantic-release automation_
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#
2+
# GitHub action for executing "semantic-release" with configuration in ".releaserc.json"
3+
#
4+
# Note about pushing to protected branches:
5+
#
6+
# The GITHUB_TOKEN credential does not have the required permission
7+
# to operate on protected branches.
8+
# Solution:
9+
# 1. generate a GitHub Personal Access Token
10+
# 2. and register it as a Repository Secrets and name it `SEMANTIC_RELEASE_GH_TOKEN`
11+
# 3. Important: set "actions/checkout" to "persist-credentials: false" otherwise it will be overwriten
12+
#
13+
# Reference
14+
# - https://conventionalcommits.org
15+
# - https://semantic-release.gitbook.io
16+
# - https://semantic-release.gitbook.io/semantic-release/recipes/ci-configurations/github-actions
17+
# - https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
18+
#
19+
20+
name: Semantic-release
21+
22+
on:
23+
push:
24+
branches:
25+
- main
26+
27+
permissions:
28+
contents: read # for checkout
29+
30+
jobs:
31+
release:
32+
name: Semantic-release
33+
runs-on: ubuntu-latest
34+
permissions:
35+
contents: write # to be able to publish a GitHub release
36+
issues: write # to be able to comment on released issues
37+
pull-requests: write # to be able to comment on released pull requests
38+
id-token: write # to enable use of OIDC for npm provenance
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
persist-credentials: false
45+
- name: Setup Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: "latest"
49+
- name: Install semantic-release
50+
run: npm install --save-dev semantic-release
51+
- name: Install semantic-release additional plugins (git)
52+
run: npm install @semantic-release/git
53+
- name: Install semantic-release additional plugins (changelog)
54+
run: npm install @semantic-release/changelog -D
55+
- name: Install semantic-release additional plugins (semantic-release-replace-plugin)
56+
run: npm install semantic-release-replace-plugin -D
57+
- name: Install semantic-release additional plugins (conventional-changelog-conventionalcommits for commit-analyzer preset)
58+
run: npm install conventional-changelog-conventionalcommits -D
59+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
60+
run: npm audit signatures
61+
- name: Release
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
64+
run: npx semantic-release
65+

0 commit comments

Comments
 (0)