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