Skip to content

Commit 7d0cfd7

Browse files
committed
chore: update branch name
1 parent bb58351 commit 7d0cfd7

File tree

6 files changed

+301
-61
lines changed

6 files changed

+301
-61
lines changed

.github/workflows/js-test-and-release.yml

Lines changed: 187 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: test & maybe release
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
workflow_dispatch:
99

@@ -16,10 +16,189 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19-
js-test-and-release:
20-
uses: pl-strflt/uci/.github/workflows/[email protected]
21-
secrets:
22-
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
23-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
24-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25-
UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }}
19+
check:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: lts/*
26+
- uses: ipfs/aegir/actions/cache-node-modules@master
27+
- run: npm run --if-present lint
28+
- run: npm run --if-present dep-check
29+
- run: npm run --if-present doc-check
30+
31+
test-node:
32+
needs: check
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os: [windows-latest, ubuntu-latest, macos-latest]
37+
node: [lts/*]
38+
fail-fast: true
39+
steps:
40+
- uses: actions/checkout@v3
41+
- uses: actions/setup-node@v3
42+
with:
43+
node-version: ${{ matrix.node }}
44+
- uses: ipfs/aegir/actions/cache-node-modules@master
45+
- run: npm run --if-present test:node
46+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
47+
with:
48+
flags: node
49+
files: .coverage/*,packages/*/.coverage/*
50+
51+
test-chrome:
52+
needs: check
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: actions/setup-node@v3
57+
with:
58+
node-version: lts/*
59+
- uses: ipfs/aegir/actions/cache-node-modules@master
60+
- run: npm run --if-present test:chrome
61+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
62+
with:
63+
flags: chrome
64+
files: .coverage/*,packages/*/.coverage/*
65+
66+
test-chrome-webworker:
67+
needs: check
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v3
71+
- uses: actions/setup-node@v3
72+
with:
73+
node-version: lts/*
74+
- uses: ipfs/aegir/actions/cache-node-modules@master
75+
- run: npm run --if-present test:chrome-webworker
76+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
77+
with:
78+
flags: chrome-webworker
79+
files: .coverage/*,packages/*/.coverage/*
80+
81+
test-firefox:
82+
needs: check
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v3
86+
- uses: actions/setup-node@v3
87+
with:
88+
node-version: lts/*
89+
- uses: ipfs/aegir/actions/cache-node-modules@master
90+
- run: npm run --if-present test:firefox
91+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
92+
with:
93+
flags: firefox
94+
files: .coverage/*,packages/*/.coverage/*
95+
96+
test-firefox-webworker:
97+
needs: check
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@v3
101+
- uses: actions/setup-node@v3
102+
with:
103+
node-version: lts/*
104+
- uses: ipfs/aegir/actions/cache-node-modules@master
105+
- run: npm run --if-present test:firefox-webworker
106+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
107+
with:
108+
flags: firefox-webworker
109+
files: .coverage/*,packages/*/.coverage/*
110+
111+
test-webkit:
112+
needs: check
113+
runs-on: ${{ matrix.os }}
114+
strategy:
115+
matrix:
116+
os: [ubuntu-latest, macos-latest]
117+
node: [lts/*]
118+
fail-fast: true
119+
steps:
120+
- uses: actions/checkout@v3
121+
- uses: actions/setup-node@v3
122+
with:
123+
node-version: lts/*
124+
- uses: ipfs/aegir/actions/cache-node-modules@master
125+
- run: npm run --if-present test:webkit
126+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
127+
with:
128+
flags: webkit
129+
files: .coverage/*,packages/*/.coverage/*
130+
131+
test-webkit-webworker:
132+
needs: check
133+
runs-on: ${{ matrix.os }}
134+
strategy:
135+
matrix:
136+
os: [ubuntu-latest, macos-latest]
137+
node: [lts/*]
138+
fail-fast: true
139+
steps:
140+
- uses: actions/checkout@v3
141+
- uses: actions/setup-node@v3
142+
with:
143+
node-version: lts/*
144+
- uses: ipfs/aegir/actions/cache-node-modules@master
145+
- run: npm run --if-present test:webkit-webworker
146+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
147+
with:
148+
flags: webkit-webworker
149+
files: .coverage/*,packages/*/.coverage/*
150+
151+
test-electron-main:
152+
needs: check
153+
runs-on: ubuntu-latest
154+
steps:
155+
- uses: actions/checkout@v3
156+
- uses: actions/setup-node@v3
157+
with:
158+
node-version: lts/*
159+
- uses: ipfs/aegir/actions/cache-node-modules@master
160+
- run: npx xvfb-maybe npm run --if-present test:electron-main
161+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
162+
with:
163+
flags: electron-main
164+
files: .coverage/*,packages/*/.coverage/*
165+
166+
test-electron-renderer:
167+
needs: check
168+
runs-on: ubuntu-latest
169+
steps:
170+
- uses: actions/checkout@v3
171+
- uses: actions/setup-node@v3
172+
with:
173+
node-version: lts/*
174+
- uses: ipfs/aegir/actions/cache-node-modules@master
175+
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
176+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
177+
with:
178+
flags: electron-renderer
179+
files: .coverage/*,packages/*/.coverage/*
180+
181+
release:
182+
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-webkit, test-webkit-webworker, test-electron-main, test-electron-renderer]
183+
runs-on: ubuntu-latest
184+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
185+
permissions:
186+
id-token: write
187+
contents: write
188+
pull-requests: write
189+
steps:
190+
- uses: actions/checkout@v3
191+
with:
192+
fetch-depth: 0
193+
- uses: actions/setup-node@v3
194+
with:
195+
node-version: lts/*
196+
- uses: ipfs/aegir/actions/cache-node-modules@master
197+
- uses: ipfs/aegir/actions/docker-login@master
198+
with:
199+
docker-token: ${{ secrets.DOCKER_TOKEN }}
200+
docker-username: ${{ secrets.DOCKER_USERNAME }}
201+
- run: npm run --if-present release
202+
env:
203+
GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN || github.token }}
204+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Semantic PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
uses: pl-strflt/.github/.github/workflows/[email protected]

.github/workflows/stale.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Close and mark stale issue
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
permissions:
8+
issues: write
9+
pull-requests: write
10+
11+
jobs:
12+
stale:
13+
uses: pl-strflt/.github/.github/workflows/[email protected]

README.md

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,10 @@
1-
# @multiformats/multiaddr <!-- omit in toc -->
2-
31
[![multiformats.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://multiformats.io)
42
[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-multiaddr.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-multiaddr)
5-
[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-multiaddr/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/multiformats/js-multiaddr/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
3+
[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-multiaddr/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/multiformats/js-multiaddr/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
64

75
> multiaddr implementation (binary + string representation of network addresses)
86
9-
## Table of contents <!-- omit in toc -->
10-
11-
- [Install](#install)
12-
- [Browser `<script>` tag](#browser-script-tag)
13-
- [Background](#background)
14-
- [What is multiaddr?](#what-is-multiaddr)
15-
- [Usage](#usage)
16-
- [Resolvers](#resolvers)
17-
- [API Docs](#api-docs)
18-
- [License](#license)
19-
- [Contribution](#contribution)
20-
21-
## Install
22-
23-
```console
24-
$ npm i @multiformats/multiaddr
25-
```
26-
27-
### Browser `<script>` tag
28-
29-
Loading this module through a script tag will make it's exports available as `MultiformatsMultiaddr` in the global namespace.
30-
31-
```html
32-
<script src="https://unpkg.com/@multiformats/multiaddr/dist/index.min.js"></script>
33-
```
34-
35-
## Background
36-
37-
### What is multiaddr?
7+
# About
388

399
A standard way to represent addresses that
4010

@@ -44,7 +14,7 @@ A standard way to represent addresses that
4414
- have a nice string representation
4515
- encapsulate well
4616

47-
## Usage
17+
## Example
4818

4919
```js
5020
import { multiaddr } from '@multiformats/multiaddr'
@@ -61,22 +31,18 @@ addr.toString()
6131
// '/ip4/127.0.0.1/udp/1234'
6232

6333
addr.protos()
64-
/*
65-
[
66-
{code: 4, name: 'ip4', size: 32},
67-
{code: 273, name: 'udp', size: 16}
68-
]
69-
*/
34+
// [
35+
// {code: 4, name: 'ip4', size: 32},
36+
// {code: 273, name: 'udp', size: 16}
37+
// ]
7038

7139
// gives you an object that is friendly with what Node.js core modules expect for addresses
7240
addr.nodeAddress()
73-
/*
74-
{
75-
family: 4,
76-
port: 1234,
77-
address: "127.0.0.1"
78-
}
79-
*/
41+
// {
42+
// family: 4,
43+
// port: 1234,
44+
// address: "127.0.0.1"
45+
// }
8046

8147
addr.encapsulate('/sctp/5678')
8248
// Multiaddr(/ip4/127.0.0.1/udp/1234/sctp/5678)
@@ -102,17 +68,31 @@ The available resolvers are:
10268

10369
A resolver receives a `Multiaddr` as a parameter and returns a `Promise<Array<string>>`.
10470

105-
## API Docs
71+
# Install
72+
73+
```console
74+
$ npm i @multiformats/multiaddr
75+
```
76+
77+
## Browser `<script>` tag
78+
79+
Loading this module through a script tag will make it's exports available as `MultiformatsMultiaddr` in the global namespace.
80+
81+
```html
82+
<script src="https://unpkg.com/@multiformats/multiaddr/dist/index.min.js"></script>
83+
```
84+
85+
# API Docs
10686

10787
- <https://multiformats.github.io/js-multiaddr>
10888

109-
## License
89+
# License
11090

11191
Licensed under either of
11292

11393
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
11494
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
11595

116-
## Contribution
96+
# Contribution
11797

11898
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"bugs": {
1212
"url": "https://github.com/multiformats/js-multiaddr/issues"
1313
},
14+
"publishConfig": {
15+
"access": "public",
16+
"provenance": true
17+
},
1418
"keywords": [
1519
"binary",
1620
"multiaddr",
@@ -63,7 +67,7 @@
6367
},
6468
"release": {
6569
"branches": [
66-
"master"
70+
"main"
6771
],
6872
"plugins": [
6973
[
@@ -171,7 +175,7 @@
171175
"uint8arrays": "^4.0.2"
172176
},
173177
"devDependencies": {
174-
"@types/sinon": "^10.0.14",
178+
"@types/sinon": "^17.0.2",
175179
"aegir": "^41.0.11",
176180
"sinon": "^17.0.0"
177181
},

0 commit comments

Comments
 (0)