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

Commit 63a3579

Browse files
authored
chore: Add release-please (#240)
* Add release-please * Fix * Fix ci.js * Rename fluence-js * Run pnpm i * Fix * Update workflows * Fix
1 parent 0d05e51 commit 63a3579

File tree

12 files changed

+349
-89
lines changed

12 files changed

+349
-89
lines changed

.github/actionlint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
self-hosted-runner:
2+
labels:
3+
- builder

.github/release-please/config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"release-type": "node",
3+
"bump-minor-pre-major": true,
4+
"bump-patch-for-minor-pre-major": true,
5+
"plugins": [
6+
{
7+
"type": "node-workspace"
8+
}
9+
],
10+
"packages": {
11+
"packages/client/api": {},
12+
"packages/js-client.node": {},
13+
"packages/js-client.web.standalone": {},
14+
"packages/tools": {},
15+
"packages/core/interfaces": {},
16+
"packages/core/js-peer": {}
17+
}
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages/client/api": "0.10.0",
3+
"packages/js-client.node": "0.5.0",
4+
"packages/js-client.web.standalone": "0.12.0",
5+
"packages/tools": "0.1.0",
6+
"packages/core/interfaces": "0.6.0",
7+
"packages/core/js-peer": "0.7.0"
8+
}

.github/workflows/changelog_config.json

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

.github/workflows/e2e.yml.disabled

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ on:
44
pull_request:
55
paths-ignore:
66
- "**.md"
7+
- ".github/**"
8+
- "!.github/workflows/e2e.yml"
9+
- "!.github/workflows/tests.yml"
10+
- "!.github/workflows/snapshot.yml"
711
push:
812
branches:
913
- "master"
14+
paths-ignore:
15+
- "**.md"
16+
- ".github/**"
17+
- "!.github/workflows/e2e.yml"
18+
- "!.github/workflows/tests.yml"
19+
- "!.github/workflows/snapshot.yml"
1020

1121
concurrency:
1222
group: "${{ github.workflow }}-${{ github.ref }}"

.github/workflows/lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: lint
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
concurrency:
11+
group: "${{ github.workflow }}-${{ github.ref }}"
12+
cancel-in-progress: true
13+
14+
jobs:
15+
pr:
16+
name: Validate PR title
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@v5
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
23+
reviewdog:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Lint actions
30+
uses: reviewdog/action-actionlint@v1
31+
env:
32+
SHELLCHECK_OPTS: "-e SC2086 -e SC2207 -e SC2128"
33+
with:
34+
reporter: github-pr-check
35+
fail_on_error: true

.github/workflows/release.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: "release-please"
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
8+
concurrency:
9+
group: "${{ github.workflow }}-${{ github.ref }}"
10+
11+
env:
12+
CI: true
13+
FORCE_COLOR: true
14+
15+
jobs:
16+
release-please:
17+
runs-on: ubuntu-latest
18+
19+
outputs:
20+
release-created: ${{ steps.release.outputs.releases_created }}
21+
pr: ${{ steps.release.outputs.pr }}
22+
23+
steps:
24+
- name: Run release-please
25+
id: release
26+
uses: google-github-actions/release-please-action@v3
27+
with:
28+
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}
29+
command: manifest
30+
config-file: .github/release-please/config.json
31+
manifest-file: .github/release-please/manifest.json
32+
33+
- name: Show output from release-please
34+
if: steps.release.outputs.releases_created
35+
env:
36+
RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }}
37+
run: echo "${RELEASE_PLEASE_OUTPUT}" | jq
38+
39+
bump-version:
40+
if: needs.release-please.outputs.pr != null
41+
runs-on: ubuntu-latest
42+
needs:
43+
- release-please
44+
45+
permissions:
46+
contents: write
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v3
51+
with:
52+
ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }}
53+
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}
54+
55+
- name: Setup pnpm
56+
uses: pnpm/[email protected]
57+
with:
58+
version: 7
59+
60+
- name: Setup node
61+
uses: actions/setup-node@v3
62+
with:
63+
node-version: "18"
64+
registry-url: "https://registry.npmjs.org"
65+
cache: "pnpm"
66+
67+
- run: pnpm i --no-frozen-lockfile
68+
69+
- name: Commit version bump
70+
uses: stefanzweifel/git-auto-commit-action@v4
71+
with:
72+
commit_message: "chore: Regenerate pnpm lock file"
73+
branch: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }}
74+
commit_user_name: fluencebot
75+
commit_user_email: [email protected]
76+
commit_author: fluencebot <[email protected]>
77+
78+
fluence-js:
79+
if: needs.release-please.outputs.release-created
80+
runs-on: ubuntu-latest
81+
needs:
82+
- release-please
83+
84+
permissions:
85+
contents: read
86+
id-token: write
87+
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v3
91+
92+
- name: Import secrets
93+
uses: hashicorp/[email protected]
94+
with:
95+
url: https://vault.fluence.dev
96+
path: jwt/github
97+
role: ci
98+
method: jwt
99+
jwtGithubAudience: "https://github.com/fluencelabs"
100+
jwtTtl: 300
101+
exportToken: false
102+
secrets: |
103+
kv/npmjs/fluencebot token | NODE_AUTH_TOKEN
104+
105+
- name: Setup pnpm
106+
uses: pnpm/[email protected]
107+
with:
108+
version: 7
109+
110+
- name: Setup node
111+
uses: actions/setup-node@v3
112+
with:
113+
node-version: "18"
114+
registry-url: "https://registry.npmjs.org"
115+
cache: "pnpm"
116+
117+
- run: pnpm i
118+
- run: pnpm -r build
119+
120+
- name: Publish to npm registry
121+
run: pnpm --no-git-checks -r publish -filter '@fluencelabs/*' --access public --tags unstable
122+
123+
slack:
124+
if: always()
125+
name: "Notify"
126+
runs-on: ubuntu-latest
127+
128+
needs:
129+
- release-please
130+
- fluence-js
131+
132+
permissions:
133+
contents: read
134+
id-token: write
135+
136+
steps:
137+
- uses: lwhiteley/dependent-jobs-result-check@v1
138+
id: status
139+
with:
140+
statuses: failure
141+
dependencies: ${{ toJSON(needs) }}
142+
143+
- name: Log output
144+
run: |
145+
echo "statuses:" "${{ steps.status.outputs.statuses }}"
146+
echo "jobs:" "${{ steps.status.outputs.jobs }}"
147+
echo "found any?:" "${{ steps.status.outputs.found }}"
148+
149+
- name: Import secrets
150+
uses: hashicorp/[email protected]
151+
with:
152+
url: https://vault.fluence.dev
153+
path: jwt/github
154+
role: ci
155+
method: jwt
156+
jwtGithubAudience: "https://github.com/fluencelabs"
157+
jwtTtl: 300
158+
exportToken: false
159+
secrets: |
160+
kv/slack/release-please webhook | SLACK_WEBHOOK_URL
161+
162+
- uses: ravsamhq/notify-slack-action@v2
163+
if: steps.status.outputs.found == 'true'
164+
with:
165+
status: "failure"
166+
notification_title: "*{workflow}* has {status_message}"
167+
message_format: "${{ steps.status.outputs.jobs }} {status_message} in <{repo_url}|{repo}>"
168+
footer: "<{run_url}>"

.github/workflows/tests.yml.disabled renamed to .github/workflows/run-tests.yml

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
name: Run tests with worflow_call
1+
name: "ci"
22

33
on:
4-
workflow_call:
5-
inputs:
6-
rust-peer-image:
7-
description: "rust-peer image tag"
8-
type: string
9-
default: "fluencelabs/fluence:minimal"
10-
avm-version:
11-
description: "@fluencelabs/avm version"
12-
type: string
13-
default: "null"
14-
marine-js-version:
15-
description: "@fluencelabs/marine-js version"
16-
type: string
17-
default: "null"
18-
ref:
19-
description: "git ref to checkout to"
20-
type: string
21-
default: "master"
4+
pull_request:
5+
paths-ignore:
6+
- "**.md"
7+
- ".github/**"
8+
- "!.github/workflows/e2e.yml"
9+
- "!.github/workflows/tests.yml"
10+
- "!.github/workflows/snapshot.yml"
11+
push:
12+
branches:
13+
- "master"
14+
paths-ignore:
15+
- "**.md"
16+
- ".github/**"
17+
- "!.github/workflows/e2e.yml"
18+
- "!.github/workflows/tests.yml"
19+
- "!.github/workflows/snapshot.yml"
20+
21+
concurrency:
22+
group: "${{ github.workflow }}-${{ github.ref }}"
23+
cancel-in-progress: true
2224

2325
env:
24-
RUST_PEER_IMAGE: "${{ inputs.rust-peer-image }}"
26+
RUST_PEER_IMAGE: "fluencelabs/fluence:minimal"
2527
FORCE_COLOR: true
2628
CI: true
2729

@@ -39,6 +41,7 @@ jobs:
3941
node-version:
4042
- 16.x
4143
- 17.x
44+
- 18.x
4245

4346
steps:
4447
- name: Import secrets
@@ -63,9 +66,6 @@ jobs:
6366

6467
- name: Checkout
6568
uses: actions/checkout@v3
66-
with:
67-
repository: fluencelabs/fluence-js
68-
ref: ${{ inputs.ref }}
6969

7070
- name: Pull rust-peer image
7171
run: docker pull $RUST_PEER_IMAGE
@@ -90,23 +90,5 @@ jobs:
9090

9191
- run: pnpm i
9292

93-
- name: Set avm version
94-
if: inputs.avm-version != 'null'
95-
uses: fluencelabs/github-actions/npm-set-dependency@main
96-
with:
97-
package: "@fluencelabs/avm"
98-
version: ${{ inputs.avm-version }}
99-
working-directory: packages/fluence-js
100-
package-manager: pnpm
101-
102-
- name: Set marine-js version
103-
if: inputs.marine-js-version != 'null'
104-
uses: fluencelabs/github-actions/npm-set-dependency@main
105-
with:
106-
package: "@fluencelabs/marine-js"
107-
version: ${{ inputs.marine-js-version }}
108-
working-directory: packages/fluence-js
109-
package-manager: pnpm
110-
11193
- run: pnpm -r build
11294
- run: pnpm -r test
File renamed without changes.

0 commit comments

Comments
 (0)