Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit b802eb1

Browse files
authored
Merge pull request #242 from ckb-cell/release/0.4.0
Merge release/0.4.0 to main branch
2 parents 88050df + 0f2be64 commit b802eb1

File tree

150 files changed

+6929
-2317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+6929
-2317
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.git
3+
.gitignore
4+
*.md
5+
tests
6+
examples
7+
dist

.github/workflows/docker.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Docker Publish
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
tags:
10+
- v*.*.*
11+
12+
jobs:
13+
docker-build-push:
14+
runs-on: ubuntu-22.04
15+
permissions:
16+
packages: write
17+
contents: read
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Docker metadata
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
context: git
27+
images: ghcr.io/${{ github.repository }}-service
28+
flavor: |
29+
latest=auto
30+
tags: |
31+
type=ref,event=tag
32+
type=semver,pattern={{version}}
33+
type=ref,event=branch
34+
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmm'}}
35+
type=sha,enable=true,prefix=sha-,format=short
36+
env:
37+
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v3
41+
42+
- name: Login to GitHub Container Registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Build Docker image
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: .
53+
target: service
54+
push: true
55+
provenance: false
56+
platforms: linux/amd64, linux/arm64
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
annotations: ${{ steps.meta.outputs.annotations }}

.github/workflows/integration-test.yaml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@ name: Integration Tests
44

55
on:
66
workflow_dispatch:
7-
pull_request:
7+
# Run integration-tests every day
8+
schedule:
9+
- cron: '59 0 * * *'
810

11+
# https://docs.github.com/en/actions/using-jobs/using-concurrency
912
concurrency:
10-
group: ${{ github.workflow }}-${{ github.ref }}
13+
group: ${{ github.workflow }}
14+
cancel-in-progress: false
1115

1216
jobs:
1317
test:
1418
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
env_set: [ xudt, spore ]
23+
1524
steps:
1625
- name: Checkout rgbpp-sdk
1726
uses: actions/checkout@v4
@@ -33,12 +42,25 @@ jobs:
3342
- name: Build packages
3443
run: pnpm run build:packages
3544

45+
3646
- name: Run integration:xudt script
3747
working-directory: ./tests/rgbpp
48+
if: ${{ matrix.env_set == 'xudt' }}
3849
run: pnpm run integration:xudt
3950
env:
40-
VITE_SERVICE_URL: ${{ secrets.SERVICE_URL }}
41-
VITE_SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }}
42-
VITE_SERVICE_ORIGIN: ${{ secrets.SERVICE_ORIGIN }}
51+
VITE_SERVICE_URL: https://api.signet.rgbpp.io
52+
VITE_SERVICE_TOKEN: ${{ secrets.SIGNET_SERVICE_TOKEN }}
53+
VITE_SERVICE_ORIGIN: https://api.signet.rgbpp.io
4354
INTEGRATION_CKB_PRIVATE_KEY: ${{ secrets.INTEGRATION_CKB_PRIVATE_KEY }}
4455
INTEGRATION_BTC_PRIVATE_KEY: ${{ secrets.INTEGRATION_BTC_PRIVATE_KEY }}
56+
57+
- name: Run integration:spore script
58+
working-directory: ./tests/rgbpp
59+
if: ${{ matrix.env_set == 'spore' }}
60+
run: pnpm run integration:spore
61+
env:
62+
VITE_SERVICE_URL: https://api.signet.rgbpp.io
63+
VITE_SERVICE_TOKEN: ${{ secrets.SIGNET_SERVICE_TOKEN }}
64+
VITE_SERVICE_ORIGIN: https://api.signet.rgbpp.io
65+
INTEGRATION_CKB_PRIVATE_KEY: ${{ secrets.INTEGRATION_CKB_SPORE_PRIVATE_KEY }}
66+
INTEGRATION_BTC_PRIVATE_KEY: ${{ secrets.INTEGRATION_BTC_SPORE_PRIVATE_KEY }}

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,29 @@ jobs:
4848
run: pnpm i
4949

5050
- name: Create bump PR or release version
51-
id: changesets
5251
uses: changesets/action@v1
52+
id: changesets
5353
with:
5454
publish: pnpm run release:packages
5555
title: "bump: assumable rgbpp-sdk version"
5656
commit: "bump: assumable rgbpp-sdk version"
5757
env:
5858
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5959
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Create comment on commit
62+
uses: actions/github-script@v7
63+
if: steps.changesets.outputs.published
64+
env:
65+
PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
66+
with:
67+
script: |
68+
const packages = JSON.parse(process.env.PACKAGES)
69+
const packagesTable = packages.map((p) => `| ${p.name} | \`${p.version}\` |`)
70+
const body = ['New official version of the rgbpp-sdk packages have been released:', '| Name | Version |', '| --- | --- |', packagesTable].join('\n')
71+
github.rest.repos.createCommitComment({
72+
commit_sha: context.sha,
73+
owner: context.repo.owner,
74+
repo: context.repo.repo,
75+
body: body,
76+
});

.github/workflows/snapshot.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,29 @@ jobs:
6363
env:
6464
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6565

66-
- name: Publish to npm
67-
id: changesets
66+
- name: Publish snapshot versions to npm
6867
uses: changesets/action@v1
68+
id: changesets
6969
with:
70-
publish: npx changeset publish --no-git-tag --snapshot --tag snap
70+
publish: npx changeset publish --snapshot --tag snap
7171
createGithubReleases: false
7272
env:
7373
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7474
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7575

76-
- name: Create commit comment
77-
uses: peter-evans/commit-comment@v3
78-
if: ${{ steps.changesets.outputs.published == 'true' }}
76+
- name: Create comment on commit
77+
uses: actions/github-script@v7
78+
if: steps.changesets.outputs.published
79+
env:
80+
PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
7981
with:
80-
token: ${{ secrets.GITHUB_TOKEN }}
81-
body: |
82-
```json
83-
${{ steps.changesets.outputs.publishedPackages }}
84-
```
82+
script: |
83+
const packages = JSON.parse(process.env.PACKAGES)
84+
const packagesTable = packages.map((p) => `| ${p.name} | \`${p.version}\` |`)
85+
const body = ['New snapshot version of the rgbpp-sdk packages have been released:', '| Name | Version |', '| --- | --- |', packagesTable].join('\n')
86+
github.rest.repos.createCommitComment({
87+
commit_sha: context.sha,
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
body: body,
91+
});

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Test the functionality of the rgbpp-sdk packages.
22

3-
name: Test
3+
name: Unit Tests
44

55
on:
66
workflow_dispatch:
@@ -52,6 +52,6 @@ jobs:
5252
- name: Run tests for packages
5353
run: pnpm run test:packages
5454
env:
55-
VITE_BTC_SERVICE_URL: ${{ secrets.SERVICE_URL }}
56-
VITE_BTC_SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }}
57-
VITE_BTC_SERVICE_ORIGIN: ${{ secrets.SERVICE_ORIGIN }}
55+
VITE_BTC_SERVICE_URL: https://btc-assets-api.testnet.mibao.pro
56+
VITE_BTC_SERVICE_TOKEN: ${{ secrets.TESTNET_SERVICE_TOKEN }}
57+
VITE_BTC_SERVICE_ORIGIN: https://btc-assets-api.testnet.mibao.pro

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ devbox.json
4242
devbox.lock
4343
.envrc
4444

45+
# examples logs
46+
examples/rgbpp/logs

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM node:20-slim AS base
2+
3+
ENV PNPM_HOME="/pnpm"
4+
ENV PATH="$PNPM_HOME:$PATH"
5+
RUN corepack enable
6+
RUN corepack use pnpm@latest
7+
8+
COPY . /app
9+
WORKDIR /app
10+
11+
FROM base AS prod-deps
12+
RUN npm pkg delete scripts.prepare
13+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
14+
15+
FROM base AS build
16+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
17+
RUN pnpm run build
18+
19+
FROM base AS service
20+
COPY --from=prod-deps /app/node_modules /node_modules
21+
COPY --from=build /app/packages /app/packages
22+
COPY --from=build /app/apps/service /app/apps/service
23+
24+
WORKDIR /app/apps/service
25+
RUN pnpm add @nestjs/cli -D
26+
27+
ENV NODE_ENV=production
28+
EXPOSE 3000
29+
CMD [ "pnpm", "start" ]

apps/next/.env.example

Lines changed: 0 additions & 2 deletions
This file was deleted.

apps/next/.gitignore

Lines changed: 0 additions & 36 deletions
This file was deleted.

apps/next/README.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

apps/next/next.config.mjs

Lines changed: 0 additions & 18 deletions
This file was deleted.

apps/next/package.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/next/src/app/favicon.ico

-25.3 KB
Binary file not shown.

apps/next/src/app/layout.tsx

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)