@metamask/eth-hd-keyring 6.0.0 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODEOWNERS +4 -0
- package/.github/workflows/build-lint-test.yml +73 -0
- package/.github/workflows/create-release-pr.yml +41 -0
- package/.github/workflows/main.yml +70 -0
- package/.github/workflows/publish-release.yml +50 -0
- package/.nvmrc +1 -1
- package/.yarn/releases/yarn-3.3.0.cjs +807 -0
- package/.yarnrc.yml +15 -0
- package/CHANGELOG.md +16 -1
- package/README.md +1 -1
- package/package.json +10 -8
- package/.yarnrc +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Build, Lint, and Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
prepare:
|
|
8
|
+
name: Prepare
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v3
|
|
12
|
+
- name: Use Node.js
|
|
13
|
+
uses: actions/setup-node@v3
|
|
14
|
+
with:
|
|
15
|
+
node-version-file: '.nvmrc'
|
|
16
|
+
cache: 'yarn'
|
|
17
|
+
- name: Install Yarn dependencies
|
|
18
|
+
run: yarn --immutable
|
|
19
|
+
|
|
20
|
+
lint:
|
|
21
|
+
name: Lint
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
needs:
|
|
24
|
+
- prepare
|
|
25
|
+
strategy:
|
|
26
|
+
matrix:
|
|
27
|
+
node-version: [14.x, 16.x, 18.x, 19.x]
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v3
|
|
30
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
31
|
+
uses: actions/setup-node@v3
|
|
32
|
+
with:
|
|
33
|
+
node-version: ${{ matrix.node-version }}
|
|
34
|
+
cache: 'yarn'
|
|
35
|
+
- run: yarn --immutable --immutable-cache
|
|
36
|
+
- run: yarn lint
|
|
37
|
+
- name: Validate RC changelog
|
|
38
|
+
if: ${{ startsWith(github.head_ref, 'release/') }}
|
|
39
|
+
run: yarn auto-changelog validate --rc
|
|
40
|
+
- name: Validate changelog
|
|
41
|
+
if: ${{ !startsWith(github.head_ref, 'release/') }}
|
|
42
|
+
run: yarn auto-changelog validate
|
|
43
|
+
- name: Require clean working directory
|
|
44
|
+
shell: bash
|
|
45
|
+
run: |
|
|
46
|
+
if ! git diff --exit-code; then
|
|
47
|
+
echo "Working tree dirty at end of job"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
test:
|
|
51
|
+
name: Test
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
needs:
|
|
54
|
+
- prepare
|
|
55
|
+
strategy:
|
|
56
|
+
matrix:
|
|
57
|
+
node-version: [14.x, 16.x, 18.x, 19.x]
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v3
|
|
60
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
61
|
+
uses: actions/setup-node@v3
|
|
62
|
+
with:
|
|
63
|
+
node-version: ${{ matrix.node-version }}
|
|
64
|
+
cache: 'yarn'
|
|
65
|
+
- run: yarn --immutable --immutable-cache
|
|
66
|
+
- run: yarn test
|
|
67
|
+
- name: Require clean working directory
|
|
68
|
+
shell: bash
|
|
69
|
+
run: |
|
|
70
|
+
if ! git diff --exit-code; then
|
|
71
|
+
echo "Working tree dirty at end of job"
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Create Release Pull Request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
base-branch:
|
|
7
|
+
description: 'The base branch for git operations and the pull request.'
|
|
8
|
+
default: 'main'
|
|
9
|
+
required: true
|
|
10
|
+
release-type:
|
|
11
|
+
description: 'A SemVer version diff, i.e. major, minor, patch, prerelease etc. Mutually exclusive with "release-version".'
|
|
12
|
+
required: false
|
|
13
|
+
release-version:
|
|
14
|
+
description: 'A specific version to bump to. Mutually exclusive with "release-type".'
|
|
15
|
+
required: false
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
create-release-pr:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
pull-requests: write
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v3
|
|
25
|
+
with:
|
|
26
|
+
# This is to guarantee that the most recent tag is fetched.
|
|
27
|
+
# This can be configured to a more reasonable value by consumers.
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
# We check out the specified branch, which will be used as the base
|
|
30
|
+
# branch for all git operations and the release PR.
|
|
31
|
+
ref: ${{ github.event.inputs.base-branch }}
|
|
32
|
+
- name: Setup Node.js
|
|
33
|
+
uses: actions/setup-node@v3
|
|
34
|
+
with:
|
|
35
|
+
node-version-file: '.nvmrc'
|
|
36
|
+
- uses: MetaMask/action-create-release-pr@v1
|
|
37
|
+
env:
|
|
38
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
39
|
+
with:
|
|
40
|
+
release-type: ${{ github.event.inputs.release-type }}
|
|
41
|
+
release-version: ${{ github.event.inputs.release-version }}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
name: Main
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check-workflows:
|
|
10
|
+
name: Check workflows
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v3
|
|
14
|
+
- name: Download actionlint
|
|
15
|
+
id: download-actionlint
|
|
16
|
+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash) 1.6.22
|
|
17
|
+
shell: bash
|
|
18
|
+
- name: Check workflow files
|
|
19
|
+
run: ${{ steps.download-actionlint.outputs.executable }} -color
|
|
20
|
+
shell: bash
|
|
21
|
+
|
|
22
|
+
build-lint-test:
|
|
23
|
+
name: Build, lint, and test
|
|
24
|
+
uses: ./.github/workflows/build-lint-test.yml
|
|
25
|
+
|
|
26
|
+
all-jobs-completed:
|
|
27
|
+
name: All jobs completed
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
needs:
|
|
30
|
+
- check-workflows
|
|
31
|
+
- build-lint-test
|
|
32
|
+
outputs:
|
|
33
|
+
PASSED: ${{ steps.set-output.outputs.PASSED }}
|
|
34
|
+
steps:
|
|
35
|
+
- name: Set PASSED output
|
|
36
|
+
id: set-output
|
|
37
|
+
run: echo "PASSED=true" >> "$GITHUB_OUTPUT"
|
|
38
|
+
|
|
39
|
+
all-jobs-pass:
|
|
40
|
+
name: All jobs pass
|
|
41
|
+
if: ${{ always() }}
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
needs: all-jobs-completed
|
|
44
|
+
steps:
|
|
45
|
+
- name: Check that all jobs have passed
|
|
46
|
+
run: |
|
|
47
|
+
passed="${{ needs.all-jobs-completed.outputs.PASSED }}"
|
|
48
|
+
if [[ $passed != "true" ]]; then
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
is-release:
|
|
52
|
+
# release merge commits come from github-actions
|
|
53
|
+
if: startsWith(github.event.commits[0].author.name, 'github-actions')
|
|
54
|
+
needs: all-jobs-pass
|
|
55
|
+
outputs:
|
|
56
|
+
IS_RELEASE: ${{ steps.is-release.outputs.IS_RELEASE }}
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: MetaMask/action-is-release@v1
|
|
60
|
+
id: is-release
|
|
61
|
+
|
|
62
|
+
publish-release:
|
|
63
|
+
needs: is-release
|
|
64
|
+
if: needs.is-release.outputs.IS_RELEASE == 'true'
|
|
65
|
+
name: Publish release
|
|
66
|
+
permissions:
|
|
67
|
+
contents: write
|
|
68
|
+
uses: ./.github/workflows/publish-release.yml
|
|
69
|
+
secrets:
|
|
70
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Publish Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
secrets:
|
|
6
|
+
NPM_TOKEN:
|
|
7
|
+
required: true
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish-release:
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v3
|
|
16
|
+
with:
|
|
17
|
+
ref: ${{ github.sha }}
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v3
|
|
20
|
+
with:
|
|
21
|
+
node-version-file: '.nvmrc'
|
|
22
|
+
- uses: MetaMask/action-publish-release@v2
|
|
23
|
+
env:
|
|
24
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
25
|
+
|
|
26
|
+
publish-npm-dry-run:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
needs: publish-release
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v3
|
|
31
|
+
with:
|
|
32
|
+
ref: ${{ github.sha }}
|
|
33
|
+
- name: Dry Run Publish
|
|
34
|
+
# omit npm-token token to perform dry run publish
|
|
35
|
+
uses: MetaMask/action-npm-publish@v2
|
|
36
|
+
|
|
37
|
+
publish-npm:
|
|
38
|
+
environment: npm-publish
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
needs: publish-npm-dry-run
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v3
|
|
43
|
+
with:
|
|
44
|
+
ref: ${{ github.sha }}
|
|
45
|
+
- name: Publish
|
|
46
|
+
uses: MetaMask/action-npm-publish@v2
|
|
47
|
+
with:
|
|
48
|
+
# This `NPM_TOKEN` needs to be manually set per-repository.
|
|
49
|
+
# Look in the repository settings under "Environments", and set this token in the `npm-publish` environment.
|
|
50
|
+
npm-token: ${{ secrets.NPM_TOKEN }}
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v18
|