-
-
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.
- Loading branch information
santi100a
committed
Mar 15, 2023
1 parent
97ef2af
commit b8355b6
Showing
22 changed files
with
747 additions
and
107 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: npm # See documentation for possible values | ||
directory: / # Location of package manifests | ||
schedule: | ||
interval: weekly |
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
name: Pull Request check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- edited | ||
- opened | ||
branches: | ||
- main | ||
paths: | ||
- src/**/*.* | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout PR | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Clone the main repo | ||
run: /usr/bin/git clone https://github.com/${{ github.repository }} main | ||
- name: Check if the PR is acceptable | ||
run: | | ||
diff -q ./tests/ ./main/tests > /dev/null | ||
diff -q ./.github/ ./main/.github > /dev/null | ||
- name: Copy test suites from main repo to PR | ||
run: cp main/tests/*.* tests/ | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Run main test suites | ||
run: yarn test |
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,38 @@ | ||
name: Continuous Deployment (CD) | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
NPM_AUTH_TOKEN: | ||
required: true | ||
GPR_AUTH_TOKEN: | ||
required: true | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
always-auth: true | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build code | ||
run: yarn build | ||
- name: Set access tokens | ||
run: | | ||
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_AUTH_TOKEN }} | ||
npm set //npm.pkg.github.com/:_authToken ${{ secrets.GPR_AUTH_TOKEN }} | ||
- name: Publish to NPM | ||
run: yarn publish --access public | ||
- name: Get ready to publish to GPR | ||
run: | | ||
jq ".name = \"@$REPO\"" package.json > temp.json | ||
mv temp.json package.json | ||
env: | ||
REPO: ${{ github.repository }} | ||
- name: Publish to GPR | ||
run: yarn publish --access public --registry https://npm.pkg.github.com/ |
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,42 @@ | ||
name: Release Workflow | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GH_TOKEN: | ||
required: true | ||
NPM_AUTH_TOKEN: | ||
required: true | ||
GPR_AUTH_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Generate tag, release name, and body | ||
run: | | ||
TAG_NAME="v$(jq -r '.version' package.json)" | ||
RELEASE_NAME="Release $TAG_NAME" | ||
BODY=$(sed -n "/## Version $(jq -r '.version' package.json | sed 's/\./\\\./g')/,/##/p" CHANGELOG.md | sed '1d;/^##/d') | ||
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | ||
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV | ||
echo "$BODY" >> release.md | ||
- name: Create release | ||
uses: ncipollo/[email protected] | ||
with: | ||
allowUpdates: true | ||
tag: ${{ env.TAG_NAME }} | ||
name: ${{ env.RELEASE_NAME }} | ||
token: ${{ secrets.GH_TOKEN }} | ||
bodyFile: release.md | ||
draft: false | ||
prerelease: false | ||
call-publisher-workflow: | ||
needs: release | ||
uses: ./.github/workflows/publish.yml | ||
secrets: | ||
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
GPR_AUTH_TOKEN: ${{ secrets.GPR_AUTH_TOKEN }} |
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,39 @@ | ||
name: Continuous Integration (CI) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- src/**/*.ts | ||
- tests/**/*.test.js | ||
- .github/workflows/test.yml | ||
- .github/workflows/release.yml | ||
- .github/workflows/publish.yml | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19.x | ||
always-auth: true | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Build source code | ||
run: yarn build | ||
|
||
- name: Run test suites | ||
run: yarn test | ||
release: | ||
needs: test | ||
uses: ./.github/workflows/release.yml | ||
secrets: | ||
GH_TOKEN: ${{ secrets.GPR_AUTH_TOKEN }} | ||
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
GPR_AUTH_TOKEN: ${{ secrets.GPR_AUTH_TOKEN }} |
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,6 @@ | ||
{ | ||
"bracketSameLine": true, | ||
"semi": true, | ||
"singleQuote": true, | ||
"useTabs": true | ||
} |
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,4 @@ | ||
# Changelog | ||
|
||
## Version 1.1.1 | ||
- Added `randomIntegers` and `randomFloats`. |
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,60 @@ | ||
# Code of Conduct | ||
|
||
## My Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, as | ||
the maintainer, I pledge to make participation in my project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, level of experience, education, | ||
socio-economic status, nationality, personal appearance, race, | ||
or religion. | ||
|
||
## My Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized or foul language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## My Responsibilities | ||
|
||
I'm responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
I have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all project spaces, and it also applies when | ||
an individual is representing the project or its community in public spaces. | ||
Examples of representing a project or community include using an official | ||
project e-mail address, posting via an official social media account, or acting | ||
as an appointed representative at an online or offline event. Representation of | ||
a project may be further defined and clarified by me. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting me at <[email protected]>. All complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. I will maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. |
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,17 @@ | ||
# Contribute | ||
|
||
## How to contribute | ||
|
||
You can [file an issue](https://github.com/santi100a/random-lib/issues) | ||
or a [pull request](https://github.com/santi100a/random-lib/pulls). | ||
You can also [start a discussion](https://github.com/santi100a/random-lib/discussions). | ||
## Types of accepted contributions and how to ask for them | ||
- Bug reports (issue/PR if you know how to fix it) | ||
- Feature requests (issue) | ||
- Code contributions (PR) | ||
- Documentation improvements (PR) | ||
|
||
**Please submit each PR independently, as I might want to merge some but not others.** | ||
|
||
## Contribution rules | ||
You must comply with the [Code of Conduct](CODE_OF_CONDUCT.md) when doing contributions. |
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
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,26 @@ | ||
# Security Policy | ||
|
||
## Reporting a Vulnerability | ||
|
||
**First see the [Code of Conduct](CODE_OF_CONDUCT.md) and [Contribution instructions](CONTRIBUTE.md)!** | ||
|
||
If you believe you have discovered a security vulnerability in this project, please email me at <[email protected]>. Please include a detailed description of the vulnerability and steps to reproduce it, along with any relevant information on the environment and configuration where the vulnerability was discovered. Please do not disclose the vulnerability publicly until it has been addressed by me. | ||
|
||
## Scope | ||
This security policy applies to all versions of the project, including any pre-release or beta versions. I will make reasonable efforts to address vulnerabilities in a timely manner, but I can make no guarantees whatsoever regarding the timeline or process for addressing vulnerabilities. | ||
|
||
## Responsible Disclosure | ||
I am committed to addressing security vulnerabilities in a responsible manner, and will follow the principles of responsible disclosure: | ||
|
||
- I will acknowledge receipt of your vulnerability report as soon as possible. | ||
- I will provide an estimated timeline for addressing the vulnerability and keep you informed of any changes to the timeline. | ||
- I will provide credit to you in the release notes for any vulnerability that you report, unless you prefer to remain anonymous. | ||
- I will not take legal action against you or disclose your identity to any third party without your consent, unless required by law. | ||
## Vulnerability Severity | ||
I will evaluate the severity of reported vulnerabilities. The severity of the vulnerability will determine the priority for addressing it. | ||
|
||
## Patching | ||
I will try my best to provide patches for all vulnerabilities that are confirmed and accepted. I will make reasonable efforts to provide patches in a timely manner, and will prioritize high-severity vulnerabilities. I may provide workarounds or mitigation advice in cases where a patch is not immediately available. | ||
|
||
## Public Disclosure | ||
I will coordinate with you to determine an appropriate timeline for public disclosure of the vulnerability, taking into account the severity of the vulnerability, the availability of patches, and any other relevant factors. I will make a best effort to release a patch for the vulnerability before publicly disclosing it, and will coordinate with other affected parties if necessary. |
Oops, something went wrong.