Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup pipelines #9

Merged
merged 9 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:lit/recommended",
"plugin:wc/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
},
"env": {
"browser": true
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"import/extensions": "off",
"import/no-import-module-exports": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"lit/no-template-map": "off",
"lit/prefer-static-styles": "off",
"class-methods-use-this": [
"error",
{
"exceptMethods": ["render", "update"]
}
],
"no-console": ["warn", { "allow": ["warn"] }],
"no-param-reassign": "off",
"no-plusplus": "off",
"no-underscore-dangle": "off",
"prefer-destructuring": "off"
},
"plugins": ["@typescript-eslint", "wc", "prettier"],
"parser": "@typescript-eslint/parser",
"overrides": [
{
"files": ["src/@types/*.d.ts"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["scripts/*.js"],
"rules": {
"import/no-extraneous-dependencies": "off",
"no-console": "off",
"no-restricted-syntax": "off"
}
}
]
}
30 changes: 30 additions & 0 deletions .github/workflows/build-react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Lint and build React"

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'packages/react/**'
- '!packages/widget/**'
- '!packages/sdk-manager/**'
- '!packages/wallet-manager/**'

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
node: [18]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn' # cache node modules
node-version: ${{ matrix.node }}
- run: corepack enable
- run: yarn set version stable
- run: yarn install --immutable # install dependencies
- run: yarn run lint:react-widget # lint code
- run: yarn run build:all # build react
31 changes: 31 additions & 0 deletions .github/workflows/build-sdk-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Lint and build SDK Manager"

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'packages/sdk-manager/**'
- '!packages/widget/**'
- '!packages/wallet-manager/**'
- '!packages/react/**'

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
node: [18]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn' # cache node modules
node-version: ${{ matrix.node }}
- run: corepack enable
- run: yarn set version stable
- run: yarn
- run: yarn run lint:sdk-manager # lint code
- run: yarn run build:wallet-manager # build wallet-manager
- run: yarn run build:sdk-manager # build widget
30 changes: 30 additions & 0 deletions .github/workflows/build-wallet-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Lint and build Wallet Manager"

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'packages/wallet-manager/**'
- '!packages/sdk-manager/**'
- '!packages/widget/**'
- '!packages/react/**'

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
node: [18]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn' # cache node modules
node-version: ${{ matrix.node }}
- run: corepack enable
- run: yarn set version stable
- run: yarn
- run: yarn run lint:wallet-manager # lint code
- run: yarn run build:wallet-manager # build widget
30 changes: 30 additions & 0 deletions .github/workflows/build-widget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Lint and build Widget"

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'packages/widget/**'
- '!packages/sdk-manager/**'
- '!packages/wallet-manager/**'
- '!packages/react/**'

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
node: [18]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn' # cache node modules
node-version: ${{ matrix.node }}
- run: corepack enable
- run: yarn set version stable
- run: yarn install --immutable
- run: yarn run lint:widget # lint code
- run: yarn run build:all # build widget
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Lint and build"

on: [pull_request]

jobs:
main:
name: Lint and build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.releases_created }}

- name: Enable corepack
run: corepack enable
if: ${{ steps.release.outputs.releases_created }}

- name: Install yarn
run: yarn set version classic
if: ${{ steps.release.outputs.releases_created }}

- name: Install dependencies
run: yarn install
if: ${{ steps.release.outputs.releases_created }}

- run: yarn lint:all
if: ${{ steps.release.outputs.releases_created }}
19 changes: 19 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Semantic PR"

on: [pull_request]

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
types: |
fix
feat
chore
revert
requireScope: false
65 changes: 65 additions & 0 deletions .github/workflows/react-widget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish React Widget to NPM

on:
push:
branches:
- main
paths:
- 'packages/react/**'
- '!packages/widget/**'
- '!packages/sdk-manager/**'
- '!packages/wallet-manager/**'
jobs:
maybe-release:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
# you should probably do this after your regular CI checks passes
- uses: google-github-actions/release-please-action@v3 # it will analyze commits and create PR with new version and updated CHANGELOG:md file. On merging it will create github release page with changelog
id: release
with:
release-type: node
token: ${{secrets.RELEASE_TOKEN}}
path: packages/react
monorepo-tags: true
default-branch: main
package-name: '@wainola/react-widget'
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"revert","hidden":true}]'

- uses: actions/checkout@v3
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.releases_created }}

- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 18
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.releases_created }}

- name: Enable corepack
run: corepack enable
if: ${{ steps.release.outputs.releases_created }}

- name: Install yarn
run: yarn set version stable
if: ${{ steps.release.outputs.releases_created }}

- name: Install dependencies
run: yarn install
if: ${{ steps.release.outputs.releases_created }}

- run: yarn build:all
if: ${{ steps.release.outputs.releases_created }}

- run: yarn build:react-widget
if: ${{ steps.release.outputs.releases_created }}

- run: npm publish --workspace=@wainola/react-widget --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.releases_created }}
62 changes: 62 additions & 0 deletions .github/workflows/sdk-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish Wallet Manager to NPM

on:
push:
branches:
- main
paths:
- 'packages/sdk-manager/**'
- '!packages/wallet-manager/**'
- '!packages/widget/**'
jobs:
maybe-release:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
# you should probably do this after your regular CI checks passes
- uses: google-github-actions/release-please-action@v3 # it will analyze commits and create PR with new version and updated CHANGELOG:md file. On merging it will create github release page with changelog
id: release
with:
release-type: node
token: ${{secrets.RELEASE_TOKEN}}
path: packages/sdk-manager
monorepo-tags: true
default-branch: main
package-name: '@builttwithsygma/sdk-manager'
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"revert","hidden":true}]'

- uses: actions/checkout@v3
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.releases_created }}

- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 18
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.releases_created }}

- name: Enable corepack
run: corepack enable
if: ${{ steps.release.outputs.releases_created }}

- name: Install yarn
run: yarn set version classic
if: ${{ steps.release.outputs.releases_created }}

- name: Install dependencies
run: yarn install
if: ${{ steps.release.outputs.releases_created }}

- run: yarn build:sdk-manager
if: ${{ steps.release.outputs.releases_created }}

# - run: npm publish --workspace=@builtwithsygma/sdk-manager --access public
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# if: ${{ steps.release.outputs.releases_created }}

Loading
Loading