-
Notifications
You must be signed in to change notification settings - Fork 31
ci: adding pre-release ci for oxygen sdk #992
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: sdk/shopify-oxygen | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, 'feat/**'] | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| branches: [main, 'feat/**'] | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| build-test-shopify-oxygen: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally speaking we should used a SHA for these instead of a version. But it may be better to do that in its own PR as I recently did for C++.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like there is also a PR against this repo #955 that might address this? Is there an easy way to get the image digest for these action images? I am having a hard time referencing them with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There just the SHA of the associated git repo. Each action is either a repo, or in a mono-repo. So the SHA of the tag associated with the release. In a mono-repo there will likely be a tag per action, such as in our case: https://github.com/launchdarkly/gh-actions/releases/tag/persistent-stores-v0.1.2 |
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| # https://shopify.dev/docs/storefronts/headless/hydrogen/getting-started#requirements | ||
| node-version: lts/* | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - id: shared | ||
| name: Shared CI Steps | ||
| uses: ./actions/ci | ||
| with: | ||
| workspace_name: '@launchdarkly/shopify-oxygen-sdk' | ||
| workspace_path: packages/sdk/shopify-oxygen | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Publishing SDKs | ||
|
|
||
| Publishing a new SDK package in this monorepo typically happens in 2 | ||
| phases: initial package publishing phase and stable release phase. | ||
|
|
||
| > [!NOTE] | ||
| > If you are moving an existing package to this monorepo, you should | ||
| > still read through the [initial publishing](#initial-package-publishing) | ||
| > and follow the relevant steps to initialize the CI implementation. | ||
|
|
||
| ## Initial Package Publishing | ||
|
|
||
| When publishing a package for the first time, developers must complete several steps not part of a typical package release. This phase is | ||
| designed to: | ||
| 1. Establish the CI implementation for the new package | ||
| 2. Generate pre-release builds for testing | ||
|
|
||
| ### Step 1. Extend `release-please-config.json` | ||
|
|
||
| When doing the initial release, you will need to add a new record to | ||
| [`release-please-config.json`](../release-please-config.json): | ||
| ``` | ||
| "packages/type/my-package": { | ||
| "bump-minor-pre-major": true, | ||
| "release-as": "0.1.0", | ||
| "bootstrap-sha": "MY_SHA" | ||
| } | ||
| ``` | ||
| > [!TIP] | ||
| > `bump-minor-pre-major` only needs to be set if you are publishing | ||
| > unstable releases (major version `0`). This option ensures that | ||
| > breaking changes will only increment minor version. | ||
|
|
||
| > [!TIP] | ||
| > `bootstrap-sha` will ensure that the conventional commits are | ||
| > calculated from a certain point and not the whole package history. | ||
| > You can find the appropriate commit sha using `git log`. | ||
|
|
||
| ## 2. Add initial release manifest | ||
|
|
||
| Add the following to `.release-please-manifest.json` | ||
| ``` | ||
| "packages/type/my-package": "0.0.0" | ||
| ``` | ||
|
|
||
| ## 3. Add option to manual workflows | ||
|
|
||
| Add `PATH_TO_YOUR_PACKAGE` to the `on.workflow_dispatch.inputs.workspace_path.options` | ||
| array in the following files: | ||
| - [`manual-publish-docs.yml`](../.github/workflows/manual-publish-docs.yml) | ||
| - [`manual-publish.yml`](../.github/workflows/manual-publish.yml) | ||
|
|
||
| ## 4. Create a CI non-release workflow for just the project | ||
|
|
||
| You will add a file in the `.github/workflows` directory that tells GHA (mostly) how to | ||
| test your SDK. Below is a simple template to get started: | ||
| ``` | ||
| name: sdk/YOUR_SDK | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, 'feat/**'] | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| branches: [main, 'feat/**'] | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| build-test-YOUR_SDK: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: lts/* | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - id: shared | ||
| name: Shared CI Steps | ||
| uses: ./actions/ci | ||
| with: | ||
| workspace_name: YOUR_PACKAGE_NAME | ||
| workspace_path: PATH_TO_YOUR_PACKAGE | ||
| ``` | ||
| > ![TIP] | ||
| > you should test your configuration on [your local machine](../.github/CI_CONTRIBUTING.md) if | ||
| > possible. | ||
|
|
||
| <!-- TODO document the stable release phase ---> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,7 @@ | ||
| { | ||
| "extends": "../../../tsconfig.json", | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "composite": true, | ||
| "rootDir": ".", | ||
| "outDir": "dist" | ||
| }, | ||
| "include": ["src/**/*.ts"], | ||
| "exclude": ["**/*.test.ts", "dist", "node_modules", "__tests__", "example"] | ||
| "include": ["src/**/*", "package.json"], | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "extends": ["../../../typedoc.base.json"], | ||
| "entryPoints": ["src/index.ts"], | ||
| "out": "docs" | ||
| } |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can manually trigger this action from this branch to determine if everything is working as expected. Pre-publishing the docs won't hurt.
You would not want to do the same for the manual-publish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc publish is successful https://github.com/launchdarkly/js-core/actions/runs/19338109015