Skip to content

Commit b4013b0

Browse files
authored
Merge branch 'main' into add-react-native-to-docs
2 parents 88ca733 + 07a2386 commit b4013b0

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
branches:
66
- main
77

8-
permissions:
9-
id-token: write # Required publishing to npm using OIDC
10-
contents: read
11-
128
jobs:
139
release:
1410
runs-on: ubuntu-latest
@@ -20,26 +16,30 @@ jobs:
2016
# Setup .npmrc file to publish to npm
2117
- name: Enable corepack
2218
run: corepack enable
23-
- uses: actions/setup-node@v4
19+
- uses: actions/setup-node@v6
2420
with:
2521
node-version-file: ".nvmrc"
2622
cache: "yarn"
2723
cache-dependency-path: "**/yarn.lock"
2824
registry-url: "https://registry.npmjs.org"
2925
scope: "@reflag"
30-
- name: update npm - remove this once we upgrade Node.js
31-
run: npm install -g npm@11.8.0
32-
- name: npm version
33-
run: npm version
3426
- name: Install dependencies
3527
run: yarn install --immutable
3628
- name: Build packages
3729
run: yarn build
3830
- name: Publish
39-
run: yarn lerna publish from-package --no-private --yes
40-
env:
41-
NPM_CONFIG_PROVENANCE: "true"
42-
NPM_CONFIG_ACCESS: "public"
31+
run: |
32+
yarn lerna list --since --parseable --no-private | while read -r pkg; do
33+
name=$(node -p "require('$pkg/package.json').name")
34+
version=$(node -p "require('$pkg/package.json').version")
35+
published=$(npm view "$name" version --json 2>/dev/null || echo "")
36+
if [ "$published" = "\"$version\"" ]; then
37+
echo "SKIP $name@$version"
38+
else
39+
echo "PUBLISH $name@$version (registry has $published)"
40+
(cd "$pkg" && npm publish --access public --provenance)
41+
fi
42+
done
4343
- name: Build docs
4444
run: yarn docs
4545
- name: Checkout docs with SSH

0 commit comments

Comments
 (0)