-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #387 from ckb-js/rc/v0.0.1-alpha
- Loading branch information
Showing
330 changed files
with
31,634 additions
and
10,670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
*.js | ||
*.md | ||
*.txt | ||
docker-compose.yml | ||
dockerfile | ||
*.toml | ||
*.sh | ||
*.rs | ||
*.lock | ||
contract/ | ||
*.mol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
|
||
comment: | ||
layout: 'reach,diff,flags,files,footer' | ||
behavior: default | ||
require_changes: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
|
||
change-template: '- #$NUMBER: $TITLE (@$AUTHOR)' | ||
change-title-escapes: '\<*_&@`' | ||
template: | | ||
## What's Changed | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Update versions and changelogs | ||
|
||
on: create | ||
|
||
jobs: | ||
default: | ||
name: Update versions and changelogs | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write # for updating PR | ||
contents: write # for opening PR | ||
env: | ||
IS_RC_BRANCH: ${{ startsWith(github.ref_name, 'rc/v') }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
# this is a patch for incompatibility between lerna@7 and npm@9 https://github.com/lerna/lerna/issues/3418#issuecomment-1337756237 | ||
- name: Remove lock file | ||
if: env.IS_RC_BRANCH == 'true' | ||
run: rm package-lock.json | ||
|
||
- name: Get version number | ||
if: env.IS_RC_BRANCH == 'true' | ||
id: version-number | ||
run: | | ||
branch_name=${{ github.ref_name }} | ||
version_number=${branch_name#rc/v} | ||
echo "version_number=${version_number}" >> $GITHUB_OUTPUT | ||
- name: Update versions and changelogs | ||
if: env.IS_RC_BRANCH == 'true' | ||
id: changelog | ||
run: | | ||
npm run bump-version ${{ steps.version-number.outputs.version_number }} | ||
git add CHANGELOG.md | ||
changelog=$(git diff HEAD CHANGELOG.md | tail -n +7 | cut -c 2-) | ||
echo -e "changelog<<EOF"$'\n'"$changelog"$'\n'EOF >> $GITHUB_OUTPUT | ||
- name: Set GPG | ||
if: env.IS_RC_BRANCH == 'true' | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Open PR to rc branch | ||
if: env.IS_RC_BRANCH == 'true' | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
title: Update versions and changelogs for ${{ steps.version-number.outputs.version_number }} | ||
commit-message: 'chore: update versions and changelogs' | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
committer: Chen Yu <[email protected]> | ||
branch: chore-update-version-for-${{ github.ref_name }} | ||
add-paths: ':!package-lock.json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
branches: | ||
- 'develop' | ||
paths: | ||
- 'packages/samples/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: restore lerna | ||
uses: actions/cache@v3 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Install project dependencies and build | ||
run: npm i | ||
|
||
- name: Build packages | ||
run: npm run build | ||
|
||
- name: Get GitHub organization or user | ||
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}' | tr -d - ) >> $GITHUB_ENV | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: docker/mvp-dapp/Dockerfile | ||
pull: true | ||
push: true | ||
tags: ${{ env.ORG }}/kuai-mvp-dapp:latest | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
redeploy: | ||
name: Redeploy webhook call | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Deploy docker container webhook | ||
uses: joelwmale/webhook-action@master | ||
env: | ||
WEBHOOK_URL: ${{ secrets.DEPLOY_WEBHOOK_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Open PR from rc branch to main branch | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- rc/v* | ||
|
||
jobs: | ||
default: | ||
name: Open PR from rc branch to main branch | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write # for updating PR | ||
contents: write # for opening PR | ||
env: | ||
IS_VERSION_MERGED: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'chore-update-version-for-rc/') }} | ||
steps: | ||
- name: Debug | ||
run: | | ||
echo $IS_VERSION_MERGED | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Open PR to main branch | ||
uses: actions/script@v6 | ||
with: | ||
script: | | ||
github.rest.pulls.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
head: context.ref, | ||
base: 'main', | ||
title: `Merge ${context.ref} to main branch`, | ||
body: `Ready to release ${context.ref}` | ||
}) | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Publish packages to npm registry | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set registry | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: restore lerna | ||
uses: actions/cache@v3 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build packages | ||
run: npm run build | ||
|
||
- name: Run test | ||
run: npx lerna run test | ||
|
||
- name: Publish | ||
run: npm run publish:all | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Release draft | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # for creating release | ||
env: | ||
IS_RC_MERGED: ${{ github.event.pull_requst.merged == true && startsWith(github.head_ref, 'rc/v')}} | ||
steps: | ||
- name: Create a release draft | ||
uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.