Skip to content

Commit 8c98244

Browse files
committed
:'(
1 parent 9153540 commit 8c98244

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

.github/workflows/release-feature-branch.yaml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ jobs:
3131
- name: Build Prisma client
3232
working-directory: drizzle-orm
3333
run: pnpm prisma generate --schema src/prisma/schema.prisma
34+
- name: Apply version suffix to packages
35+
shell: bash
36+
run: |
37+
set -euxo pipefail
38+
suffix=$(git rev-parse --short HEAD)
39+
40+
packages=(
41+
"drizzle-orm"
42+
"drizzle-kit"
43+
"drizzle-zod"
44+
"drizzle-seed"
45+
"drizzle-typebox"
46+
"drizzle-valibot"
47+
"drizzle-arktype"
48+
"eslint-plugin-drizzle"
49+
)
50+
51+
for pkg in "${packages[@]}"; do
52+
pushd "$pkg" >/dev/null
53+
54+
base_version="$(jq -r '.version' package.json)"
55+
new_version="${base_version}-${suffix}"
56+
57+
echo "Setting $pkg version to $new_version"
58+
59+
jq --arg v "$new_version" '.version = $v' package.json > package.json.tmp
60+
mv package.json.tmp package.json
61+
62+
popd >/dev/null
63+
done
3464
- name: Build all
3565
run: pnpm build:artifact
3666
# Upload compiled JS for tests to reuse
@@ -344,10 +374,9 @@ jobs:
344374
shell: bash
345375
run: |
346376
set -euxo pipefail
347-
old_version="$(tar -xOf ./artifacts/package.tgz package/package.json | jq -r .version)"
348-
sha="$(git rev-parse --short HEAD)"
349-
version="$old_version-$sha"
350-
tag="${{ github.ref_name }}-$sha"
377+
version="$(tar -xOf ./artifacts/package.tgz package/package.json | jq -r .version)"
378+
tag="${{ github.ref_name }}"
379+
351380
is_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"
352381
if [[ "$is_published" == "true" ]]; then
353382
echo "\`${{ matrix.package }}@$version\` already published, tagging \`$tag\`" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)