Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release workflow setup via GH actions #222

Merged
merged 16 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build

on:
workflow_dispatch:
push:
pull_request:
branches: [ $default-branch ]
Expand Down
33 changes: 16 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: Release
name: Test, Build, Release

on:
workflow_dispatch:
inputs:
shouldPublish:
description: 'Publish'
required: true
default: true
type: boolean

jobs:
lint:
Expand Down Expand Up @@ -64,7 +70,11 @@ jobs:
- name: Test
run: yarn test

compile:
compile_publish:
needs:
- lint
- test

runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -94,25 +104,14 @@ jobs:
- name: Compile
run: yarn build

publish:
needs:
- lint
- test
- compile
runs-on: ubuntu-latest
steps:
- name: Set Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: fregante/setup-git-user@v1

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

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

23 changes: 23 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Release

How to publish new releases for this project.

## Versioning

[semver](https://semver.org/) should be followed when deciding new release versions.

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.

ex: `@rsocket/[email protected]`

Lerna will not push the git tags after creation. You should push the git tags once you are confident in your changes.

## Publishing

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.

The `Test, Build, Release` Workflow will:

- Run automated linting & tests
- Compile/build various packages
- Publish built packages to NPM
3 changes: 3 additions & 0 deletions packages/rsocket-adapter-rxjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down
3 changes: 3 additions & 0 deletions packages/rsocket-composite-metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down
3 changes: 3 additions & 0 deletions packages/rsocket-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@
*/

import { RSocketConnector, RSocketServer } from "rsocket-core";
import { Codec, RSocketRequester, RSocketResponder } from "rsocket-messaging";
import { RxRequestersFactory, RxRespondersFactory } from "rsocket-adapter-rxjs";
import {
Codec,
RSocketRequester,
RSocketResponder,
} from "rsocket-messaging";
import {
RxRequestersFactory,
RxRespondersFactory,
} from "rsocket-adapter-rxjs";
import { TcpClientTransport } from "rsocket-transport-tcp-client";
import { TcpServerTransport } from "rsocket-transport-tcp-server";
import { exit } from "process";
Expand Down
3 changes: 3 additions & 0 deletions packages/rsocket-messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down
3 changes: 3 additions & 0 deletions packages/rsocket-tcp-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { TcpDuplexConnection } from "../TcpDuplexConnection";
import * as net from "net";
import sinon from "sinon";
import EventEmitter from "events";
import { Demultiplexer, FrameHandler, Multiplexer } from "rsocket-core/src";
import {
Demultiplexer,
FrameHandler,
Multiplexer,
} from "rsocket-core/src";
import { mock } from "jest-mock-extended";

describe("TcpClientTransport", function () {
Expand Down
3 changes: 3 additions & 0 deletions packages/rsocket-tcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down
3 changes: 3 additions & 0 deletions packages/rsocket-websocket-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down
3 changes: 3 additions & 0 deletions packages/rsocket-websocket-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
"clean": "rimraf -rf ./dist",
Expand Down