Skip to content

Commit 749e8c1

Browse files
committed
Merge branch 'main' into sameeran/ff-3682-use-salt-in-flag-key-hash-to-getobfuscatedprecomputedflag
2 parents b178a6c + ead7863 commit 749e8c1

File tree

6 files changed

+418
-100
lines changed

6 files changed

+418
-100
lines changed

.github/workflows/publish.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,50 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v3
11+
12+
- name: Parse version from tag
13+
id: version
14+
uses: release-kit/semver@v2
15+
16+
- name: Display Release Plan
17+
if: ${{ !github.event.release.prerelease && !steps.version.outputs.prerelease }}
18+
run: |
19+
echo "Publishing release ${{ steps.version.outputs.full }}"
20+
21+
- name: Display Pre-release Plan
22+
if: ${{ github.event.release.prerelease && steps.version.outputs.prerelease }}
23+
run: |
24+
echo "Publishing pre-relese ${{ steps.version.outputs.full }}"
25+
26+
- name: Validate inputs
27+
if: ${{ (github.event.release.prerelease && !steps.version.outputs.prerelease) || (!github.event.release.prerelease && steps.version.outputs.prerelease) }}
28+
run: |
29+
RED='\033[0;31m'
30+
NC='\033[0m' # No Color
31+
echo -e "${RED}Pre-release label in semver but GitHub release is not marked as pre-release or vice-versa${NC}"
32+
exit 1;
33+
1134
- uses: actions/setup-node@v3
1235
with:
1336
node-version: '18.x'
1437
- run: yarn install
1538
- run: yarn test
16-
- uses: JS-DevTools/npm-publish@v3
39+
40+
- name: Publish Latest
41+
uses: JS-DevTools/npm-publish@v3
42+
if: ${{ !github.event.release.prerelease && !steps.version.outputs.prerelease }}
1743
with:
1844
token: ${{ secrets.NPM_TOKEN }}
1945
access: public
46+
47+
- name: Publish Pre-release
48+
uses: JS-DevTools/npm-publish@v3
49+
if: ${{ github.event.release.prerelease && steps.version.outputs.prerelease }}
50+
with:
51+
token: ${{ secrets.NPM_TOKEN }}
52+
access: public
53+
tag: ${{ steps.version.outputs.prerelease }}
54+
2055
- name: Upload npm debug log
2156
if: failure() # This step will run only if the previous steps failed
2257
uses: actions/upload-artifact@v4

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,21 @@ It may be useful to install the local version of this package as you develop the
3232
This can be done in two steps:
3333
1. Open the directory with the client SDK you want to add this library to, and run `make prepare`
3434
2. Add the local version of this library to the SDK you are developing by running `yarn add --force file:../js-client-sdk-common` (this assumes both repositories were cloned into the same directory)
35+
36+
### Publishing Releases
37+
38+
When publishing releases, the following rules apply:
39+
40+
- **Standard Release**:
41+
- Create a release with tag format `vX.Y.Z` (e.g., `v4.3.5`)
42+
- Keep "Set as latest release" checked
43+
- Package will be published to NPM with the `latest` tag
44+
45+
- **Pre-release**:
46+
- Create a release with tag format `vX.Y.Z-label.N` (e.g., `v4.3.5-alpha.1`)
47+
- Check the "Set as pre-release" option
48+
- Package will be published to NPM with the pre-release label as its tag (e.g., `alpha.1`)
49+
50+
**Note**: The release will not be published if:
51+
- A pre-release is marked as "latest"
52+
- A pre-release label is used without checking "Set as pre-release"

0 commit comments

Comments
 (0)