-
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 29, 2023
1 parent
b33a529
commit e7e4520
Showing
19 changed files
with
469 additions
and
140 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
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 @@ | ||
'CI failed': '**/*.*' |
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,23 @@ | ||
name: Welcome message for issues | ||
on: | ||
issues: | ||
types: | ||
- opened | ||
permissions: | ||
issues: write | ||
jobs: | ||
welcome-author: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Say hi | ||
uses: jungwinter/comment@v1 | ||
with: | ||
type: create | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue_number: ${{ github.event.issue.number }} | ||
body: | | ||
Make sure to comply with the [Code of Conduct]( | ||
https://github.com/${{ github.repository }}/blob/main/CODE_OF_CONDUCT.md), | ||
[security policy](https://github.com/${{ github.repository }}/blob/main/SECURITY.md) | ||
and [contribution guidelines](https://github.com/${{ github.repository }}/blob/main/CONTRIBUTING.md) | ||
before contributing to this repo. |
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,31 @@ | ||
name: Report PR build failed | ||
on: | ||
workflow_call: | ||
inputs: | ||
number: | ||
required: true | ||
type: number | ||
pr-author: | ||
required: true | ||
type: string | ||
jobs: | ||
report-pr-build-failed: | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Report the build failed | ||
uses: jungwinter/comment@v1 | ||
with: | ||
type: create | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue_number: ${{ inputs.number }} | ||
body: | | ||
Hi, @${{ inputs.pr-author }}! I'm afraid the CI check for PR #${{ inputs.number }} has failed! | ||
Don't worry, it'll run again if you commit any changes to this PR. | ||
- name: Label PR as "CI failed" | ||
uses: actions/labeler@v4 | ||
with: | ||
sync-label: true | ||
repo-token: ${{ secrets.GITHUB_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,47 @@ | ||
name: Pull Request check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- edited | ||
- opened | ||
- synchronize | ||
paths: | ||
- src/**/*.* | ||
jobs: | ||
test: | ||
permissions: | ||
pull-requests: write | ||
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: cd .. && sudo /usr/bin/git clone https://github.com/${{ github.repository }} main && cd - | ||
- name: Check if the PR is acceptable | ||
run: | | ||
diff -q ./tests/ ../main/tests | ||
diff -q ./.github/ ../main/.github | ||
- name: Copy test suites from main repo to PR | ||
run: cp ../main/tests/*.* tests/ | ||
- name: Get rid of the main repo's clone | ||
run: sudo rm -rf ../main | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Build code | ||
run: yarn build | ||
- name: Run main test suites | ||
run: yarn test | ||
- name: Report build failed (if any) | ||
if: failure() | ||
uses: ./.github/workflows/pr-build-failed.yml | ||
with: | ||
pr-author: ${{ github.event.pull_request.user.login }} | ||
number: ${{ github.event.pull_request.number }} |
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,23 @@ | ||
name: Welcome message for pull requests | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
say-hi: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Say hi | ||
uses: jungwinter/comment@v1 | ||
with: | ||
type: create | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue_number: ${{ github.event.pull_request.number }} | ||
body: | | ||
Hi, ${{ github.event.pull_request.user.login }}! Welcome to ${{ github.repository }} issues! | ||
Make sure to comply with the [Code of Conduct]( | ||
https://github.com/${{ github.repository }}/blob/main/CODE_OF_CONDUCT.md), [security policy]( | ||
https://github.com/${{ github.repository }}/blob/main/SECURITY.md) and [contribution guidelines | ||
](https://github.com/${{ github.repository }}/blob/main/CONTRIBUTING.md) before contributing to | ||
this repo. |
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,100 @@ | ||
name: Continuous Integration (CI) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- src/**/*.* | ||
|
||
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: | ||
permissions: | ||
contents: write | ||
needs: test | ||
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/release-action@v1.12.0 | ||
with: | ||
allowUpdates: true | ||
tag: ${{ env.TAG_NAME }} | ||
name: ${{ env.RELEASE_NAME }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
bodyFile: release.md | ||
draft: false | ||
prerelease: false | ||
publish-npm: | ||
needs: release | ||
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 }} | ||
- name: Publish to NPM | ||
run: yarn publish --access public | ||
publish-gpr: | ||
needs: release | ||
permissions: | ||
packages: write | ||
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 //npm.pkg.github.com/:_authToken ${{ secrets.GPR_AUTH_TOKEN }} | ||
- 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,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"useTabs": true, | ||
"trailingComma": "none", | ||
"semi": 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 0.0.5 | ||
- Fixed, refined, and modified functions. |
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,10 @@ | ||
# Contribute | ||
|
||
## How to contribute | ||
|
||
You can [file an issue](https://github.com/santi100a/equal-lib/issues) | ||
or a [pull request](https://github.com/santi100a/equal-lib/pulls). | ||
You can also [start a discussion](https://github.com/santi100a/equal-lib/discussions). | ||
|
||
## Contribution rules | ||
You must comply with the [Code of Conduct](CODE_OF_CONDUCT.md) when doing contributions. |
Oops, something went wrong.