diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 899162e..34d3b49 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,4 +2,3 @@ # More details are here: https://help.github.com/articles/about-codeowners/ /.github/ @fuxingloh -/pnpm-lock.yaml @fuxingloh diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..d979ee5 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:base", "helpers:pinGitHubActionDigests", ":semanticCommits", ":semanticCommitTypeAll(bump)"], + "dependencyDashboard": true, + "dependencyDashboardAutoclose": false, + "major": { + "dependencyDashboardApproval": false + }, + "rangeStrategy": "bump", + "packageRules": [ + { + "matchPackageNames": ["node", "npm", "pnpm", "yarn", "typescript", "@types/node"], + "groupName": "engines", + "enabled": false + }, + { + "matchPackagePatterns": ["^@contentedjs/"], + "groupName": "@contentedjs" + }, + { + "matchPackagePatterns": ["^@eslint/", "^eslint$"], + "groupName": "@eslint" + } + ] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16ab659..9955741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,9 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' @@ -37,7 +37,7 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' @@ -51,9 +51,9 @@ jobs: name: Lint [prettier] runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' @@ -67,9 +67,9 @@ jobs: name: Lint [eslint] runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' diff --git a/.github/workflows/oss-governance-labeler.yml b/.github/workflows/pr-labeler.yml similarity index 93% rename from .github/workflows/oss-governance-labeler.yml rename to .github/workflows/pr-labeler.yml index 153df75..ef350f0 100644 --- a/.github/workflows/oss-governance-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -1,4 +1,4 @@ -name: OSS Governance Labeler +name: PR Labeler on: pull_request_target: diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index bbb04fa..9794f8f 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -17,6 +17,6 @@ jobs: name: Draft Release runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@65c5fb495d1e69aa8c08a3317bc44ff8aabe9772 # v5.24.0 + - uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 274f5dc..f2c6a70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: result: ${{ steps.version.outputs.result }} steps: - id: version - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | const tag = "${{ github.event.release.tag_name }}"; @@ -34,9 +34,9 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' @@ -57,3 +57,43 @@ jobs: - run: npm config delete "//registry.npmjs.org/:_authToken" --location=global if: always() + + ghcr: + name: Release GHCR + runs-on: ubuntu-latest + needs: version + environment: GHCR Packages + permissions: + contents: read + packages: write + strategy: + fail-fast: false + matrix: + package: + - karfia-agent + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version-file: '.nvmrc' + + - run: corepack enable pnpm + + - run: pnpm install --frozen-lockfile + + - uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + - uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 + with: + platforms: linux/amd64,linux/arm64 + + - run: docker buildx create --use --bootstrap --driver=docker-container + + - run: pnpm -r exec npm version ${{ needs.version.outputs.result }} --git-tag-version=false + + - run: pnpm turbo run push:docker --filter=${{ matrix.package }} --concurrency=1 diff --git a/definitions/bip122-000000000019d6689c085ae165831e93/package.json b/definitions/bip122-000000000019d6689c085ae165831e93/package.json index a933cf0..13f3321 100644 --- a/definitions/bip122-000000000019d6689c085ae165831e93/package.json +++ b/definitions/bip122-000000000019d6689c085ae165831e93/package.json @@ -5,6 +5,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MPL-2.0", "scripts": { "lint": "eslint .", "test": "jest" @@ -26,6 +27,5 @@ "@workspace/tsconfig": "workspace:*", "karfia-definition": "workspace:*", "karfia-testcontainers": "workspace:*" - }, - "licnese": "MPL-2.0" + } } diff --git a/definitions/bip122-0f9188f13cb7b2c71f2a335e3a4fc328/package.json b/definitions/bip122-0f9188f13cb7b2c71f2a335e3a4fc328/package.json index 6e24dfe..13221f4 100644 --- a/definitions/bip122-0f9188f13cb7b2c71f2a335e3a4fc328/package.json +++ b/definitions/bip122-0f9188f13cb7b2c71f2a335e3a4fc328/package.json @@ -2,6 +2,9 @@ "name": "@karfia/bip122-0f9188f13cb7b2c71f2a335e3a4fc328", "version": "0.0.0", "private": false, + "repository": { + "url": "git+https://github.com/fuxingloh/karfia" + }, "license": "MPL-2.0", "scripts": { "lint": "eslint .", diff --git a/definitions/bip122-279b1a87aedc7b9471d4ad4e5f12967a/package.json b/definitions/bip122-279b1a87aedc7b9471d4ad4e5f12967a/package.json index f083b31..b47cf2e 100644 --- a/definitions/bip122-279b1a87aedc7b9471d4ad4e5f12967a/package.json +++ b/definitions/bip122-279b1a87aedc7b9471d4ad4e5f12967a/package.json @@ -5,6 +5,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MPL-2.0", "scripts": { "lint": "eslint .", "test": "jest" @@ -26,6 +27,5 @@ "@workspace/tsconfig": "workspace:*", "karfia-definition": "workspace:*", "karfia-testcontainers": "workspace:*" - }, - "licnese": "MPL-2.0" + } } diff --git a/definitions/bip122-d744db74fb70ed42767ae028a129365f/package.json b/definitions/bip122-d744db74fb70ed42767ae028a129365f/package.json index 2b8e4b5..ee22711 100644 --- a/definitions/bip122-d744db74fb70ed42767ae028a129365f/package.json +++ b/definitions/bip122-d744db74fb70ed42767ae028a129365f/package.json @@ -5,6 +5,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MPL-2.0", "scripts": { "lint": "eslint .", "test": "jest" @@ -26,6 +27,5 @@ "@workspace/tsconfig": "workspace:*", "karfia-definition": "workspace:*", "karfia-testcontainers": "workspace:*" - }, - "licnese": "MPL-2.0" + } } diff --git a/definitions/eip155-1337/package.json b/definitions/eip155-1337/package.json index 9c4bc99..89832e5 100644 --- a/definitions/eip155-1337/package.json +++ b/definitions/eip155-1337/package.json @@ -5,6 +5,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MPL-2.0", "scripts": { "lint": "eslint .", "test": "jest" @@ -26,6 +27,5 @@ "@workspace/tsconfig": "workspace:*", "karfia-definition": "workspace:*", "karfia-testcontainers": "workspace:*" - }, - "licnese": "MPL-2.0" + } } diff --git a/definitions/eip155-31337/hardhat.json b/definitions/eip155-31337/hardhat.json index da9fd25..f82c614 100644 --- a/definitions/eip155-31337/hardhat.json +++ b/definitions/eip155-31337/hardhat.json @@ -5,8 +5,8 @@ "name": "Hardhat", "containers": { "hardhat": { - "image": "docker.io/karfia/eip155-31337:hardhat-2.19.4", - "source": "https://github.com/fuxingloh/karfia/tree/main/definitions/eip155-31337/hardhat.Dockerfile", + "image": "ghcr.io/fuxingloh/hardhat-container:2.19.4", + "source": "https://github.com/fuxingloh/hardhat-container", "resources": { "cpu": 0.25, "memory": 256 diff --git a/definitions/eip155-31337/hardhat/Dockerfile b/definitions/eip155-31337/hardhat/Dockerfile deleted file mode 100644 index cde2c6b..0000000 --- a/definitions/eip155-31337/hardhat/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM node:18-alpine -WORKDIR /hardhat - -COPY ./hardhat.package.json ./package.json -RUN npm install - -COPY ./hardhat.config.js ./hardhat.config.js - -EXPOSE 8545 -ENTRYPOINT ["npx", "hardhat", "node"] diff --git a/definitions/eip155-31337/hardhat/hardhat.config.js b/definitions/eip155-31337/hardhat/hardhat.config.js deleted file mode 100644 index 991d513..0000000 --- a/definitions/eip155-31337/hardhat/hardhat.config.js +++ /dev/null @@ -1,4 +0,0 @@ -/** @type import('hardhat/config').HardhatUserConfig */ -module.exports = { - solidity: '0.8.19', -}; diff --git a/definitions/eip155-31337/hardhat/hardhat.package.json b/definitions/eip155-31337/hardhat/hardhat.package.json deleted file mode 100644 index a6dac00..0000000 --- a/definitions/eip155-31337/hardhat/hardhat.package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "eip155-31337-hardhat", - "private": true, - "version": "0.0.0", - "scripts": { - "build": "docker build --tag docker.io/karfia/eip155-31337:hardhat-2.19.4 ." - }, - "dependencies": { - "hardhat": "2.19.4" - } -} diff --git a/definitions/eip155-31337/hardhat/package.json b/definitions/eip155-31337/hardhat/package.json deleted file mode 100644 index 4b9c062..0000000 --- a/definitions/eip155-31337/hardhat/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@karfia/eip155-31337-hardhat", - "version": "0.0.0", - "private": true, - "scripts": { - "build": "docker build --tag docker.io/karfia/eip155-31337:hardhat-2.19.4 ." - } -} diff --git a/definitions/eip155-31337/hardhat/turbo.json b/definitions/eip155-31337/hardhat/turbo.json deleted file mode 100644 index 9781d21..0000000 --- a/definitions/eip155-31337/hardhat/turbo.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://turbo.build/schema.json", - "extends": ["//"], - "pipeline": { - "build": { - "inputs": ["Dockerfile", "hardhat.config.js", "hardhat.package.json"], - "dependsOn": ["^build"] - } - } -} diff --git a/definitions/eip155-31337/package.json b/definitions/eip155-31337/package.json index 708306f..a52768d 100644 --- a/definitions/eip155-31337/package.json +++ b/definitions/eip155-31337/package.json @@ -5,6 +5,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MPL-2.0", "scripts": { "lint": "eslint .", "test": "jest" @@ -22,11 +23,9 @@ "preset": "@workspace/jest-preset" }, "devDependencies": { - "@karfia/eip155-31337-hardhat": "workspace:*", "@workspace/jest-preset": "workspace:*", "@workspace/tsconfig": "workspace:*", "karfia-definition": "workspace:*", "karfia-testcontainers": "workspace:*" - }, - "licnese": "MPL-2.0" + } } diff --git a/packages/karfia-agent/Dockerfile b/packages/karfia-agent/Dockerfile index a05481d..de1fdb5 100644 --- a/packages/karfia-agent/Dockerfile +++ b/packages/karfia-agent/Dockerfile @@ -43,12 +43,12 @@ RUN pnpm turbo run build --filter=karfia-agent # Run agent FROM node:20-alpine AS runner -RUN addgroup --system --gid 1001 karfia-agent && \ - adduser --system --uid 1001 karfia-agent -USER karfia-agent +RUN addgroup --system --gid 1001 karfia && \ + adduser --system --uid 1001 karfia +USER karfia EXPOSE 1194 WORKDIR /app/packages/karfia-agent -COPY --from=builder --chown=karfia-agent:karfia-agent /app /app +COPY --from=builder --chown=karfia:karfia /app /app CMD node "server.js" diff --git a/packages/karfia-agent/package.json b/packages/karfia-agent/package.json index b00ccdb..bc2171d 100644 --- a/packages/karfia-agent/package.json +++ b/packages/karfia-agent/package.json @@ -5,11 +5,13 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MPL-2.0", "scripts": { "build": "tsc --project tsconfig.build.json", - "build:docker": "docker build -t docker.io/karfia/karfia-agent:$(node -p \"require('./package.json').version\") -f Dockerfile ../../", + "build:docker": "docker build -t ghcr.io/fuxingloh/karfia-agent:$(node -p \"require('./package.json').version\") -f Dockerfile ../../", "clean": "tsc --build --clean", "lint": "eslint .", + "push:docker": "docker buildx build -t ghcr.io/fuxingloh/karfia-agent:$(node -p \"require('./package.json').version\") -f Dockerfile ../../ --output type=registry --platform linux/amd64,linux/arm64", "test": "jest --passWithNoTests" }, "lint-staged": { @@ -35,6 +37,5 @@ "devDependencies": { "@workspace/jest-preset": "workspace:*", "@workspace/tsconfig": "workspace:*" - }, - "licnese": "MPL-2.0" + } } diff --git a/packages/karfia-cdk8s/package.json b/packages/karfia-cdk8s/package.json deleted file mode 100644 index b11ecdf..0000000 --- a/packages/karfia-cdk8s/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "karfia-cdk8s", - "version": "0.0.0", - "private": false, - "repository": { - "url": "git+https://github.com/fuxingloh/karfia" - } -} diff --git a/packages/karfia-core/package.json b/packages/karfia-core/package.json deleted file mode 100644 index e1f6857..0000000 --- a/packages/karfia-core/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "karfia-core", - "version": "0.0.0", - "private": false, - "repository": { - "url": "git+https://github.com/fuxingloh/karfia" - } -} diff --git a/packages/karfia-definition/package.json b/packages/karfia-definition/package.json index 0123f56..4a33e5b 100644 --- a/packages/karfia-definition/package.json +++ b/packages/karfia-definition/package.json @@ -6,6 +6,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MPL-2.0", "main": "index.json", "types": "index.d.ts", "files": [ @@ -36,6 +37,5 @@ "devDependencies": { "@workspace/tsconfig": "workspace:*", "json-schema-to-typescript": "^13.1.2" - }, - "licnese": "MPL-2.0" + } } diff --git a/packages/karfia-docker-compose/__snapshots__/synthesizer.unit.ts.snap b/packages/karfia-docker-compose/__snapshots__/synthesizer.unit.ts.snap index ba3c440..5eafbdc 100644 --- a/packages/karfia-docker-compose/__snapshots__/synthesizer.unit.ts.snap +++ b/packages/karfia-docker-compose/__snapshots__/synthesizer.unit.ts.snap @@ -11,7 +11,7 @@ name: eip155_1337_ganache_7_9_1 services: karfia-agent: container_name: karfia-agent-\${KARFIA_DEPLOYMENT_ID} - image: docker.io/karfia/karfia-agent:0.0.0 + image: ghcr.io/fuxingloh/karfia-agent:0.0.0 ports: - '0:1194' environment: diff --git a/packages/karfia-docker-compose/package.json b/packages/karfia-docker-compose/package.json index 97ebbc6..562b7c3 100644 --- a/packages/karfia-docker-compose/package.json +++ b/packages/karfia-docker-compose/package.json @@ -5,6 +5,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MIT", "bin": { "karfia-docker-compose": "./bin.js" }, @@ -41,6 +42,5 @@ "@types/js-yaml": "^4.0.9", "@workspace/jest-preset": "workspace:*", "@workspace/tsconfig": "workspace:*" - }, - "licnese": "MIT" + } } diff --git a/packages/karfia-docker-compose/synthesizer.ts b/packages/karfia-docker-compose/synthesizer.ts index 962efbb..c53ea4f 100644 --- a/packages/karfia-docker-compose/synthesizer.ts +++ b/packages/karfia-docker-compose/synthesizer.ts @@ -100,7 +100,7 @@ export class Synthesizer { return { 'karfia-agent': { container_name: 'karfia-agent-${KARFIA_DEPLOYMENT_ID}', - image: `docker.io/karfia/karfia-agent:${version}`, + image: `ghcr.io/fuxingloh/karfia-agent:${version}`, ports: ['0:1194'], environment: { // Docker compose automatically evaluate environment literals here diff --git a/packages/karfia-testcontainers/package.json b/packages/karfia-testcontainers/package.json index 672406a..ef4a746 100644 --- a/packages/karfia-testcontainers/package.json +++ b/packages/karfia-testcontainers/package.json @@ -5,6 +5,7 @@ "repository": { "url": "git+https://github.com/fuxingloh/karfia" }, + "license": "MIT", "files": [ "**/*.d.ts", "**/*.d.ts.map", @@ -36,6 +37,5 @@ "devDependencies": { "@workspace/jest-preset": "workspace:*", "@workspace/tsconfig": "workspace:*" - }, - "licnese": "MIT" + } } diff --git a/packages/karfia/package.json b/packages/karfia/package.json deleted file mode 100644 index 2fd624f..0000000 --- a/packages/karfia/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "karfia", - "version": "0.0.0", - "private": false, - "repository": { - "url": "git+https://github.com/fuxingloh/karfia" - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a5bed8f..e36fbc0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,9 +128,6 @@ importers: definitions/eip155-31337: devDependencies: - '@karfia/eip155-31337-hardhat': - specifier: workspace:* - version: link:hardhat '@workspace/jest-preset': specifier: workspace:* version: link:../../workspace/jest-preset @@ -144,10 +141,6 @@ importers: specifier: workspace:* version: link:../../packages/karfia-testcontainers - definitions/eip155-31337/hardhat: {} - - packages/karfia: {} - packages/karfia-agent: dependencies: '@trpc/server': @@ -176,10 +169,6 @@ importers: specifier: workspace:* version: link:../../workspace/tsconfig - packages/karfia-cdk8s: {} - - packages/karfia-core: {} - packages/karfia-definition: dependencies: ajv: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e79098b..4a344d5 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,4 @@ packages: - - 'definitions' - 'definitions/*' - - 'definitions/*/*' - 'packages/*' - 'workspace/*' diff --git a/turbo.json b/turbo.json index e695f64..a90729a 100644 --- a/turbo.json +++ b/turbo.json @@ -14,6 +14,9 @@ "outputs": [], "dependsOn": [] }, + "push:docker": { + "cache": false + }, "test": { "inputs": ["tsconfig.json", "./**/*.ts", "./**/*.unit.ts", "./tests-i9n/**", "./tests-e2e/**"], "dependsOn": ["^build"]