Skip to content

Commit dbc6090

Browse files
authored
Release workflow setup via GH actions (#222)
* chore: release workflow * docs: add RELEASE.md
1 parent c7eea30 commit dbc6090

13 files changed

Lines changed: 78 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build
22

33
on:
4+
workflow_dispatch:
45
push:
56
pull_request:
67
branches: [ $default-branch ]

.github/workflows/release.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
name: Release
1+
name: Test, Build, Release
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
shouldPublish:
7+
description: 'Publish'
8+
required: true
9+
default: true
10+
type: boolean
511

612
jobs:
713
lint:
@@ -64,7 +70,11 @@ jobs:
6470
- name: Test
6571
run: yarn test
6672

67-
compile:
73+
compile_publish:
74+
needs:
75+
- lint
76+
- test
77+
6878
runs-on: ubuntu-latest
6979

7080
steps:
@@ -94,25 +104,14 @@ jobs:
94104
- name: Compile
95105
run: yarn build
96106

97-
publish:
98-
needs:
99-
- lint
100-
- test
101-
- compile
102-
runs-on: ubuntu-latest
103-
steps:
104-
- name: Set Git Identity
105-
run: |
106-
git config --global user.name 'github-actions[bot]'
107-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
108-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
109-
env:
110-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
- uses: fregante/setup-git-user@v1
111108

112109
- name: Set NPM Token
113110
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
114111
env:
115112
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
116113

117114
- name: Publish
118-
run: yarn lerna publish from-package --yes
115+
if: ${{ github.event.inputs.shouldPublish == 'true' }}
116+
run: yarn lerna publish from-package --yes --no-verify-access
117+

RELEASE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Release
2+
3+
How to publish new releases for this project.
4+
5+
## Versioning
6+
7+
[semver](https://semver.org/) should be followed when deciding new release versions.
8+
9+
You can either set versions in the `package.json` files manually, or use the `lerna version` command to set them via the Lerna CLI. When setting versions manually, you will also need to set the git tags for each package and version. For this reason, it is recommended you use the `lerna version` command, which will create these tags automatically.
10+
11+
ex: `@rsocket/adapter-rxjs@1.0.0-alpha.1`
12+
13+
Lerna will not push the git tags after creation. You should push the git tags once you are confident in your changes.
14+
15+
## Publishing
16+
17+
The `Test, Build, Release` Workflow on GitHub can be run to [manually trigger](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) publishing of packages to NPM. This workflow will only publish versions which do not already exist on NPM.
18+
19+
The `Test, Build, Release` Workflow will:
20+
21+
- Run automated linting & tests
22+
- Compile/build various packages
23+
- Publish built packages to NPM

packages/rsocket-adapter-rxjs/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"files": [
77
"dist"
88
],
9+
"publishConfig": {
10+
"access": "public"
11+
},
912
"scripts": {
1013
"build": "yarn run clean && yarn run compile",
1114
"clean": "rimraf -rf ./dist",

packages/rsocket-composite-metadata/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"files": [
77
"dist"
88
],
9+
"publishConfig": {
10+
"access": "public"
11+
},
912
"scripts": {
1013
"build": "yarn run clean && yarn run compile",
1114
"clean": "rimraf -rf ./dist",

packages/rsocket-core/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"files": [
77
"dist"
88
],
9+
"publishConfig": {
10+
"access": "public"
11+
},
912
"scripts": {
1013
"build": "yarn run clean && yarn run compile",
1114
"clean": "rimraf -rf ./dist",

packages/rsocket-examples/src/rxjs/ClientServerCompositeMetadataRouteExample.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@
1515
*/
1616

1717
import { RSocketConnector, RSocketServer } from "rsocket-core";
18-
import { Codec, RSocketRequester, RSocketResponder } from "rsocket-messaging";
19-
import { RxRequestersFactory, RxRespondersFactory } from "rsocket-adapter-rxjs";
18+
import {
19+
Codec,
20+
RSocketRequester,
21+
RSocketResponder,
22+
} from "rsocket-messaging";
23+
import {
24+
RxRequestersFactory,
25+
RxRespondersFactory,
26+
} from "rsocket-adapter-rxjs";
2027
import { TcpClientTransport } from "rsocket-transport-tcp-client";
2128
import { TcpServerTransport } from "rsocket-transport-tcp-server";
2229
import { exit } from "process";

packages/rsocket-messaging/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"files": [
77
"dist"
88
],
9+
"publishConfig": {
10+
"access": "public"
11+
},
912
"scripts": {
1013
"build": "yarn run clean && yarn run compile",
1114
"clean": "rimraf -rf ./dist",

packages/rsocket-tcp-client/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"files": [
77
"dist"
88
],
9+
"publishConfig": {
10+
"access": "public"
11+
},
912
"scripts": {
1013
"build": "yarn run clean && yarn run compile",
1114
"clean": "rimraf -rf ./dist",

packages/rsocket-tcp-client/src/__tests__/TcpClientTransport.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { TcpDuplexConnection } from "../TcpDuplexConnection";
33
import * as net from "net";
44
import sinon from "sinon";
55
import EventEmitter from "events";
6-
import { Demultiplexer, FrameHandler, Multiplexer } from "rsocket-core/src";
6+
import {
7+
Demultiplexer,
8+
FrameHandler,
9+
Multiplexer,
10+
} from "rsocket-core/src";
711
import { mock } from "jest-mock-extended";
812

913
describe("TcpClientTransport", function () {

0 commit comments

Comments
 (0)