|
3 | 3 | This directory contains Github Actions for building, deploying, releasing |
4 | 4 | libraries in this monorepo. |
5 | 5 |
|
| 6 | +## Creating pre-releases modules |
| 7 | + |
| 8 | +The following steps are to create a pre release modules which would walk through the initial |
| 9 | +CI work needed for new SDKs. |
| 10 | + |
| 11 | +### 1. Extend `release-please-config.json` |
| 12 | + |
| 13 | +Add a record of your new SDK package to `packages` |
| 14 | +``` |
| 15 | +"PATH_TO_YOUR_PACKAGE": { |
| 16 | + "bump-minor-pre-major": true, |
| 17 | + "prerelease": true |
| 18 | +} |
| 19 | +``` |
| 20 | +> NOTE: the `PATH_TO_YOUR_PACKAGE` needs to match the path in `package.json` |
| 21 | +> eg `packages/sdk/server-node` |
| 22 | +
|
| 23 | +This is the minimum changes you need to do. `bump-minor-pre-major` option means only |
| 24 | +minor version will be incremented while your package is in pre-release state. |
| 25 | +> Pre-release packages **MUST** be in major version `0` |
| 26 | +
|
| 27 | +### 2. Add initial release manifest |
| 28 | + |
| 29 | +Add the following to `.release-please-manifest.json` |
| 30 | +``` |
| 31 | +"PATH_TO_YOUR_PACKAGE": "0.0.0" |
| 32 | +``` |
| 33 | + |
| 34 | +### 3. Add option to manual workflows |
| 35 | + |
| 36 | +Add `PATH_TO_YOUR_PACKAGE` to the `on.workflow_dispatch.inputs.workspace_path.options` |
| 37 | +array in the following files: |
| 38 | +- [`manual-publish-docs.yml`](./workflows/manual-publish-docs.yml) |
| 39 | +- [`manual-publish.yml`](./workflows/manual-publish.yml) |
| 40 | + |
| 41 | +### 4. Create a CI non-release workflow for just the project |
| 42 | + |
| 43 | +You will add a file in the `.github/workflows` directory that tells GHA (mostly) how to |
| 44 | +test your SDK. Below is a simple template to get started: |
| 45 | +``` |
| 46 | +name: sdk/YOUR_SDK |
| 47 | +
|
| 48 | +on: |
| 49 | + push: |
| 50 | + branches: [main, 'feat/**'] |
| 51 | + paths-ignore: |
| 52 | + - '**.md' |
| 53 | + pull_request: |
| 54 | + branches: [main, 'feat/**'] |
| 55 | + paths-ignore: |
| 56 | + - '**.md' |
| 57 | +
|
| 58 | +jobs: |
| 59 | + build-test-YOUR_SDK: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: actions/setup-node@v4 |
| 64 | + with: |
| 65 | + node-version: lts/* |
| 66 | + registry-url: 'https://registry.npmjs.org' |
| 67 | + - id: shared |
| 68 | + name: Shared CI Steps |
| 69 | + uses: ./actions/ci |
| 70 | + with: |
| 71 | + workspace_name: YOUR_PACKAGE_NAME |
| 72 | + workspace_path: PATH_TO_YOUR_PACKAGE |
| 73 | +``` |
| 74 | +> NOTE: you should test your configuration on [your local machine](#local-testing-using-act) if |
| 75 | +> possible. |
| 76 | +
|
6 | 77 | ## Local testing using act |
7 | 78 |
|
8 | 79 | You can use [act](https://nektosact.com/usage/index.html) to run github actions locally for testing. |
|
0 commit comments