Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
hisorange committed Oct 3, 2022
0 parents commit f392e10
Show file tree
Hide file tree
Showing 25 changed files with 1,934 additions and 0 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: 'CI'

on:
workflow_dispatch:
push:
paths:
- '**.ts'
- '**.js'
- '**.yml'
- '**.json'
pull_request:
paths:
- '**.ts'
- '**.js'
- '**.yml'
- '**.json'

jobs:
tests:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Expose GIT Commit Data
uses: rlespinasse/[email protected]

- name: Install the Interpreter
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn

- name: Load the Cached Dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies
run: yarn install

- name: Transpile to Javascript
run: yarn build

- name: Test
run: yarn test

# - name: Collect coverage
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

outputs:
commit_message: ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}

# Run publish only when the branch is matches, and the commit message could match a release pattern.
publish:
name: Publish Packages
runs-on: ubuntu-latest
needs: tests
if: ${{ startsWith(needs.tests.outputs.commit_message, 'Release') && success() && github.ref == 'refs/heads/main' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install the Interpreter
uses: actions/setup-node@v2
with:
node-version: 16.x
always-auth: true
cache: yarn

- name: Load the Cached Dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Dependencies
run: yarn install

- name: Build from source
run: yarn build

- name: Publish to NPM
id: npm-publish
uses: pascalgn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Change the Interpreter for GPR
if: ${{ steps.npm-publish.outputs.changed == 'true' }}
uses: actions/setup-node@v2
with:
node-version: 16.x
registry-url: 'https://npm.pkg.github.com'
scope: '@hisorange'
cache: yarn

- name: Publish to GPR
if: ${{ steps.npm-publish.outputs.changed == 'true' }}
run: yarn publish --non-interactive
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

outputs:
changed: ${{ steps.npm-publish.outputs.changed == 'true' }}
version: ${{ steps.npm-publish.outputs.version }}

release:
name: Release GH
runs-on: ubuntu-latest
needs: [tests, publish]
if: ${{ success() && needs.publish.outputs.changed == 'true' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.publish.outputs.version }}
tag_name: ${{ needs.publish.outputs.version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Worker miscs
workers/*/target
dist/
workers/*/**/*.rs.bk
workers/*/Cargo.lock
workers/*/bin/
workers/*/pkg/
workers/*/wasm-pack.log
workers/*/worker/
node_modules/
workers/*/.cargo-ok
app/build/

build

.DS_Store


# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# SvelteKit build / generate output
.svelte-kit

# End of https://www.toptal.com/developers/gitignore/api/node
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
.npmignore
.prettierrc
.vscode
node_modules
src
tsconfig.json
yarn.lock
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"arrowParens": "avoid",
"semi": true,
"trailingComma": "all",
"tabWidth": 2,
"printWidth": 80
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/node_modules": true
}
}
Loading

0 comments on commit f392e10

Please sign in to comment.