Skip to content

Commit

Permalink
feat: Initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Sep 11, 2023
1 parent 2c7acd9 commit bc2e918
Show file tree
Hide file tree
Showing 53 changed files with 3,668 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Auto detect text files and perform LF normalization
* text=auto

# Force the following filetypes to have unix eols, so Windows does not break them
*.* text eol=lf

# These files are text and should be normalized (Convert crlf => lf)
.browserlistrc text
*.js text
*.xml text
*.iml text
*.jsx text
*.ts text
*.tsx text
*.yml text
*.yaml text
*.nycrc text
*.toml text
*.pug text
*.md text
*.scss text
*.sass text
*.css text
*.less text
*.json text
LICENSE text
CHANGELOG text

*.ico binary
*.png binary
*.jpg binary
*.jpeg binary
*.webp binary
*.mp3 binary
*.wav binary
*.gif binary
*.gz binary
*.tgz binary
*.gz binary
*.br binary
*.tgz binary
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Alorel
6 changes: 6 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are supported funding model platforms

github:
- Alorel
custom:
- "https://paypal.me/alorel"
21 changes: 21 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build
description: Common build steps
runs:
using: composite
steps:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
registry-url: https://npm.pkg.github.com

- name: Install dependencies
run: npm ci
shell: bash
env:
NODE_AUTH_TOKEN: ${{ github.token }}

- name: Build
shell: bash
run: npm run rollup
70 changes: 70 additions & 0 deletions .github/actions/release-stable/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release stable
description: Releases changes to the branch
inputs:
changelog:
description: changelog
required: true
major:
required: true
description: major version
minor:
required: true
description: minor version
patch:
required: true
description: patch version
issues-closed:
description: Issues closed by the release
runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: release
ref: release

- working-directory: release
shell: bash
run: >
rm -rvf * &&
cp -vr ../dist/* . &&
git add . &&
git commit -m "Sync with ${{ github.sha }} of ${{ github.ref_name }}" &&
git push;
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: false
generateReleaseNotes: false
makeLatest: false
commit: ${{ github.sha }}
body: ${{ inputs.changelog }}
tag: v${{ inputs.major }}

- uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: false
generateReleaseNotes: false
makeLatest: false
commit: ${{ github.sha }}
body: ${{ inputs.changelog }}
tag: v${{ inputs.major }}.${{ inputs.minor }}

- uses: ncipollo/release-action@v1
with:
allowUpdates: false
prerelease: false
generateReleaseNotes: false
commit: ${{ github.sha }}
body: ${{ inputs.changelog }}
tag: v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}

- name: Notify
if: ${{ inputs.issues-closed }}
uses: ./dist/notify
with:
tag: v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}
issues: ${{ inputs.issues-closed }}
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
commit-message:
prefix: deps
prefix-development: "deps(dev)"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: deps
prefix-development: "deps(dev)"
ignore:
- dependency-name: "*"
update-types:
- version-update:semver-minor
- version-update:semver-patch
16 changes: 16 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://github.com/Ezard/semantic-prs

enabled: true
commitsOnly: true
types:
- feat
- fix
- docs
- refactor
- build
- ci
- chore
- deps
scopes:
- deps
- deps-dev
35 changes: 35 additions & 0 deletions .github/workflows/dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Dry run
on:
- pull_request
jobs:
dryrun:
runs-on: ubuntu-latest
name: Dry run
permissions:
packages: read
contents: read
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
fetch-tags: true

- name: Build
uses: ./.github/actions/build

- uses: ./dist
name: Parse release
id: parse-release
with:
minor-types: |
feat: Features
patch-types: |
fix: Bug Fixes
trivial-types: |
chore: Maintenance
deps: Dependency updates
ci: CI & Build
build: CI & Build
refactor: Refactors
docs: Documentation
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
on:
push:
branches:
- master
- stable
name: Release
jobs:
release:
runs-on: ubuntu-latest
name: Release
permissions:
packages: read
contents: write
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
fetch-tags: true

- name: Build
uses: ./.github/actions/build

- uses: ./dist
name: Parse release
id: parse-release
with:
stay-at-zero: true
minor-types: |
feat: Features
patch-types: |
fix: Bug Fixes
trivial-types: |
chore: Maintenance
deps: Dependency updates
ci: CI & Build
build: CI & Build
refactor: Refactors
docs: Documentation
- name: Release
uses: ./.github/actions/release-stable
if: ${{ steps.parse-release.outputs.should-release && github.ref_name == 'stable' }}
with:
major: ${{ steps.parse-release.outputs.next-version-major }}
minor: ${{ steps.parse-release.outputs.next-version-minor }}
patch: ${{ steps.parse-release.outputs.next-version-patch }}
changelog: ${{ steps.parse-release.outputs.changelog }}
issues-closed: ${{ steps.parse-release.outputs.issues-closed }}

- name: Generate next tag
if: ${{ steps.parse-release.outputs.should-release && github.ref_name == 'master' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: true
generateReleaseNotes: false
makeLatest: false
updateOnlyUnreleased: true
name: Upcoming release
commit: ${{ github.sha }}
body: ${{ steps.parse-release.outputs.changelog }}
tag: next
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
*.log
/dist/
/release/
/.nyc_output
/coverage

/tmp.mjs
/tmp.ts
/tmp
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/auto_sync.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/git_toolbox_prj.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/semantic-release-lite.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@alorel:registry=https://npm.pkg.github.com
Loading

0 comments on commit bc2e918

Please sign in to comment.