Skip to content

Commit d405312

Browse files
committed
ci: update publish-dev to run every 12hrs + publish-latest to publish all packages
1 parent d10cfdb commit d405312

File tree

4 files changed

+66
-64
lines changed

4 files changed

+66
-64
lines changed
Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
1-
name: (CommandKit) Publish Dev Builds
1+
name: Publish development builds
22

33
on:
4+
schedule:
5+
- cron: '0 */12 * * *'
46
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
8-
paths:
9-
- 'packages/commandkit/**'
10-
- 'packages/create-commandkit/**'
11-
- 'packages/legacy/**'
12-
- 'packages/redis/**'
13-
- 'packages/i18n/**'
14-
- 'packages/devtools/**'
15-
- 'packages/devtools-ui/**' # this is not a package we want to publish, but devtools depends on it
16-
- 'packages/cache/**'
177

188
jobs:
199
publish:
20-
name: 🚀 Publish Dev Builds
10+
name: Publish development builds
2111
runs-on: ubuntu-latest
2212
timeout-minutes: 10
2313
steps:
2414
- uses: pnpm/action-setup@v4
2515
with:
26-
version: '9.15.0'
16+
version: '10.11.0'
2717

2818
- uses: actions/checkout@v4
2919

@@ -32,22 +22,22 @@ jobs:
3222
node-version: 22
3323
registry-url: https://registry.npmjs.org
3424

35-
- name: 💾 Cache pnpm store
25+
- name: Cache pnpm store
3626
uses: actions/cache@v4
3727
with:
3828
path: ~/.pnpm-store
3929
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
4030
restore-keys: |
4131
${{ runner.os }}-pnpm-
4232
43-
- name: 🍳 Install dependencies
33+
- name: Install dependencies
4434
run: pnpm install --frozen-lockfile
4535

46-
- name: 🔢 Set version suffix
36+
- name: Set version suffix
4737
id: version
4838
run: echo "suffix=-dev.$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
4939

50-
- name: 📝 Update package versions
40+
- name: Update package versions
5141
run: |
5242
suffix="${{ steps.version.outputs.suffix }}"
5343
for dir in packages/*; do
@@ -61,13 +51,12 @@ jobs:
6151
"
6252
done
6353
64-
- name: 🧱 Build packages
65-
run: pnpm build
54+
- name: Build packages
55+
run: turbo build --filter='./packages/*'
6656

67-
- name: 🚀 Publish each package
57+
- name: Publish packages
6858
env:
6959
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
70-
# NPM_CONFIG_PROVENANCE: true
7160
run: |
7261
PACKAGES=(
7362
"commandkit:packages/commandkit"
@@ -81,11 +70,11 @@ jobs:
8170
8271
for entry in "${PACKAGES[@]}"; do
8372
IFS=":" read -r name path <<< "$entry"
84-
echo "📦 Publishing $name..."
73+
echo "Publishing $name..."
8574
(pnpm --filter="$name" publish --no-git-checks --access public --tag dev && echo "✅ Published $name") || echo "❌ Failed to publish $name"
8675
done
8776
88-
- name: 🚫 Deprecate previous dev versions
77+
- name: Deprecate previous development versions
8978
env:
9079
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
9180
run: |
@@ -100,7 +89,7 @@ jobs:
10089
)
10190
10291
for pkg in "${PACKAGES[@]}"; do
103-
echo "📉 Deprecating previous dev version of $pkg..."
92+
echo "Deprecating previous development version of $pkg..."
10493
(
10594
ALL_VERSIONS=$(npm info "$pkg" versions -json)
10695
VERSION_TO_DEPRECATE=$(echo "$ALL_VERSIONS" | node -e "
@@ -109,6 +98,6 @@ jobs:
10998
const versionToDeprecate = devVersions[devVersions.length - 2];
11099
console.log(versionToDeprecate);
111100
")
112-
[ -n "$VERSION_TO_DEPRECATE" ] && npm deprecate "$pkg@$VERSION_TO_DEPRECATE" "Deprecated dev version." && echo "✅ Deprecated $VERSION_TO_DEPRECATE"
113-
) || echo "⚠️ Skipped deprecation for $pkg (maybe not enough dev versions)"
101+
[ -n "$VERSION_TO_DEPRECATE" ] && npm deprecate "$pkg@$VERSION_TO_DEPRECATE" "Deprecated development version." && echo "✅ Deprecated $VERSION_TO_DEPRECATE"
102+
) || echo "⚠️ Skipped deprecation for $pkg (maybe not enough development versions)"
114103
done
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish latest builds
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
name: Publish latest builds
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: pnpm/action-setup@v4
13+
with:
14+
version: '10.11.0'
15+
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
registry-url: https://registry.npmjs.org
22+
23+
- name: Install dependencies
24+
run: pnpm install --frozen-lockfile
25+
26+
- name: Build packages
27+
run: turbo build --filter='./packages/*'
28+
29+
- name: Publish packages
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
32+
run: |
33+
PACKAGES=(
34+
"commandkit:packages/commandkit"
35+
"create-commandkit:packages/create-commandkit"
36+
"@commandkit/legacy:packages/legacy"
37+
"@commandkit/redis:packages/redis"
38+
"@commandkit/i18n:packages/i18n"
39+
"@commandkit/devtools:packages/devtools"
40+
"@commandkit/cache:packages/cache"
41+
)
42+
43+
for entry in "${PACKAGES[@]}"; do
44+
IFS=":" read -r name path <<< "$entry"
45+
echo "Publishing $name..."
46+
(pnpm --filter="$name" publish --no-git-checks --access public && echo "✅ Published $name") || echo "❌ Failed to publish $name"
47+
done

.github/workflows/publish.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

turbo.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dependsOn": ["^build"]
66
},
77
"lint": {
8-
"dependsOn": ["^build", "^lint"]
8+
"dependsOn": ["^lint", "^build"]
99
}
1010
}
11-
}
11+
}

0 commit comments

Comments
 (0)