Skip to content

Commit

Permalink
Merge branch 'main' into async-ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
goastler authored Dec 13, 2023
2 parents f17aa19 + 456dceb commit 23295e1
Show file tree
Hide file tree
Showing 681 changed files with 34,431 additions and 41,214 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ jspm_packages/
typings/
.npm
build/
protocol/target
protocol/target
.next
71 changes: 57 additions & 14 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,39 @@ module.exports = {
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
'plugin:yaml/recommended',
'plugin:json/recommended',
'plugin:toml/standard',
'eslint:recommended',
'plugin:regexp/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended', // must be last!
'prettier', // must be last! disables rules which conflict with prettier
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['workspaces', 'unused-imports', '@typescript-eslint', 'sort-imports-es6-autofix', 'prettier'],
plugins: [
'@typescript-eslint',
'workspaces',
'unused-imports',
'@html-eslint',
'sort-imports-es6-autofix',
// do not add prettier to plugins otherwise rule conflicts will occur between prettier and eslint! run prettier as a separate command
],
root: true,
rules: {
'@typescript-eslint/no-unused-vars': 'warn', // allow unused vars
'@typescript-eslint/no-explicit-any': 'warn', // allow any type
'@typescript-eslint/prefer-for-of': 'warn', // allow indexed loops
'@typescript-eslint/consistent-type-assertions': 'off', // needs tsconfig to be set up
'@typescript-eslint/consistent-indexed-object-style': 'off', // allow indexed objects instead of Record<A, B>
'@typescript-eslint/array-type': 'off', // allow Array<A> or A[]
'@typescript-eslint/consistent-type-definitions': 'off', // allow type Foo = { a: string } or interface Foo { a: string }
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'unused-imports/no-unused-vars': 'off',
//"indent": ["error", 4],
//"indent": "off",
'sort-imports': [
Expand All @@ -48,5 +55,41 @@ module.exports = {
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
'json/*': ['error', { allowComments: true }],
},
overrides: [
{
files: ['*.html'],
parser: '@html-eslint/parser',
extends: ['plugin:@html-eslint/recommended'],
rules: {
'@html-eslint/no-extra-spacing-attrs': 'off',
'@html-eslint/require-closing-tags': 'off',
},
},
{
files: [
'*.ts',
'*.tsx',
'*.js',
'*.jsx',
'*.mjs',
'*.cjs',
'*.json',
'*.yaml',
'*.yml',
'*.toml',
'*.d.ts',
'*.cts',
'*.mts',
'.*.json',
'.*.js',
'.*.mjs',
'.*.cjs',
'.*.yaml',
'.*.yml',
'.*.toml',
],
},
],
}
38 changes: 38 additions & 0 deletions .github/actions/print_vars/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Print Vars'
description: 'Prints github varibles'
runs:
using: 'composite'
steps:
- name: github context
shell: bash
run: echo "${{ toJson(github) }}"
- name: env context
shell: bash
run: echo "${{ toJson(env) }}"
- name: vars context
shell: bash
run: echo "${{ toJson(vars) }}"
- name: job context
shell: bash
run: echo "${{ toJson(job) }}"
- name: steps context
shell: bash
run: echo "${{ toJson(steps) }}"
- name: runner context
shell: bash
run: echo "${{ toJson(runner) }}"
- name: secrets context
shell: bash
run: echo "${{ toJson(secrets) }}"
- name: strategy context
shell: bash
run: echo "${{ toJson(strategy) }}"
- name: matrix context
shell: bash
run: echo "${{ toJson(matrix) }}"
- name: needs context
shell: bash
run: echo "${{ toJson(needs) }}"
- name: inputs context
shell: bash
run: echo "${{ toJson(inputs) }}"
89 changes: 89 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: bump_version

on:
# run manually
workflow_dispatch:
inputs:
version:
type: string
description: Version number (e.g. 1.2.3)
required: true

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
bump_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install npm
run: npm i -g npm@$(cat package.json | jq -r .engines.npm)

- run: mkdir -p protocol/cargo-cache
- run: mkdir -p protocol/target
- run: mkdir -p node_modules
- run: mkdir -p ~/.cache/Cypress

- name: Restore cache
uses: actions/cache/restore@v3
with:
path: |
protocol/cargo-cache
protocol/target
node_modules
~/.cache/Cypress
# note that restoring a cache in github is a pain. The trailing '-' matches any string after the '-', therefore 'abc-' would match a cache named 'abc-1234' or 'abc-5678', etc.
# the problem is 'abc-' will not match a cache named 'abc'! So if you're using wildcard cache name selectors like this, you need a field that changes as the suffix to become the wildcard
# here we're setting the key to an unused cache key so it falls back to the wildcard selector in `restore-keys`
key: some-unused-cache-key
restore-keys: |
project-cache-${{ runner.os }}-${{ runner.arch }}-
- run: ls -la ~/.cache/Cypress || true
- run: ls -la protocol/cargo-cache || true
- run: ls -la protocol/target/ink || true
- run: ls -la node_modules || true

- name: Install dependencies
run: npm ci

- name: Build
run: |
npm run build -w @prosopo/scripts
npm run build -w @prosopo/protocol-dev
- name: Bump version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# make a new branch for the version changes
git switch -c bump-version-${{ github.event.inputs.version }}
# make the version changes
npm run version ${{ github.event.inputs.version }}
# rebuild typechain
npm run build:typechain
# set the author in git
git config user.name "prosoponator[bot]"
git config user.email "[email protected]"
# commit the version changes
git add .
git commit -m "Bump version to ${{ github.event.inputs.version }}"
# push version changes
git push --set-upstream origin bump-version-${{ github.event.inputs.version }}
# create a PR for the release
ID=$(gh pr create --base main --title "Release ${{ github.event.inputs.version }}" --fill 2>&1 | grep http | xargs -n1 basename)
# enable auto-merge via squash merge
gh pr merge $ID --auto --squash
69 changes: 0 additions & 69 deletions .github/workflows/check_version.yml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
steps:
# Checkout the repo
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install npm
run: npm i -g npm@$(cat package.json | jq -r .engines.npm)

- run: mkdir -p protocol/cargo-cache
- run: mkdir -p protocol/target
Expand All @@ -44,8 +49,8 @@ jobs:
restore-keys: |
project-cache-${{ runner.os }}-${{ runner.arch }}-
- run: npm install -g [email protected]
- run: npm install
- run: npm run removePolkadotJSWarnings

- name: Clippy
run: |
Expand Down
Loading

0 comments on commit 23295e1

Please sign in to comment.