Skip to content

Commit

Permalink
feat: version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
santi100a committed Apr 1, 2023
1 parent 8c7785a commit 55041dc
Show file tree
Hide file tree
Showing 25 changed files with 3,031 additions and 349 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
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
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'CI failed': '**/*.*'
23 changes: 23 additions & 0 deletions .github/workflows/issue-welcome.yml
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.
34 changes: 0 additions & 34 deletions .github/workflows/main.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/pr-build-failed.yml
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 }}

47 changes: 47 additions & 0 deletions .github/workflows/pr-check.yml
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 }}
25 changes: 25 additions & 0 deletions .github/workflows/pr-welcome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Welcome message for pull requests
on:
pull_request:
types:
- opened

jobs:
say-hi:
permissions:
pull-requests: write
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.
102 changes: 102 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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/
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
node_modules
# yarn
yarn.lock
node_modules/
dev/
coverage/

# pnpm
pnpm-lock.yaml

# npm
package-lock.json
*.log
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
src
tests
.github
coverage
.prettierrc
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"useTabs": true,
"trailingComma": "none",
"semi": true
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

# Version 1.1.1
- Modified and refined many things.
Loading

0 comments on commit 55041dc

Please sign in to comment.