Skip to content

Commit ce13f38

Browse files
Merge branch 'main' into workflows
2 parents 03a5cdc + 47ba9c8 commit ce13f38

File tree

4 files changed

+48
-75
lines changed

4 files changed

+48
-75
lines changed

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

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -330,37 +330,25 @@ jobs:
330330
permissions:
331331
contents: read
332332
id-token: write
333+
# force empty so npm can use OIDC
334+
env:
335+
NODE_AUTH_TOKEN: ""
336+
NPM_TOKEN: ""
333337
steps:
334-
- uses: actions/checkout@v4
335-
336-
- uses: actions/setup-node@v4
337-
with:
338-
node-version: '22'
339-
registry-url: 'https://registry.npmjs.org'
340-
341-
- uses: pnpm/action-setup@v3
342-
name: Install pnpm
343-
id: pnpm-install
344-
with:
345-
version: latest
346-
run_install: false
347-
348-
- name: Get pnpm store directory
349-
id: pnpm-cache
350-
shell: bash
351-
run: |
352-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
353-
354-
- uses: actions/cache@v4
355-
name: Setup pnpm cache
356-
with:
357-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
358-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
359-
restore-keys: |
360-
${{ runner.os }}-pnpm-store-
361-
362-
- name: Install dependencies
363-
run: pnpm install
338+
- uses: actions/checkout@v5
339+
- uses: pnpm/action-setup@v4
340+
with: { run_install: false }
341+
- uses: actions/setup-node@v6
342+
with: { node-version: '24', cache: 'pnpm', cache-dependency-path: pnpm-lock.yaml }
343+
- run: pnpm install --frozen-lockfile --prefer-offline
344+
345+
# >= 11.5.1 for trusted publishing
346+
- name: Update NPM
347+
run: npm install -g npm@latest
348+
349+
# nuke, so npm can use OIDC
350+
- name: Remove temp npmrc
351+
run: rm -f "$NPM_CONFIG_USERCONFIG"
364352

365353
- name: Check preconditions
366354
id: checks
@@ -375,7 +363,6 @@ jobs:
375363
376364
if [[ "$is_version_published" == "true" ]]; then
377365
echo "\`${{ matrix.package }}$version\` already published, adding tag \`$tag\`" >> $GITHUB_STEP_SUMMARY
378-
npm dist-tag add ${{ matrix.package }}@$version $tag
379366
else
380367
{
381368
echo "version=$version"
@@ -396,12 +383,12 @@ jobs:
396383
if: steps.checks.outputs.has_new_release == 'true'
397384
working-directory: ${{ matrix.package }}
398385
shell: bash
399-
env:
400-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
401386
run: npm run pack
402387

403388
- name: Publish
404389
if: github.event_name == 'push' && steps.checks.outputs.has_new_release == 'true'
390+
working-directory: ${{ matrix.package }}
391+
shell: bash
405392
run: |
406393
tag="${{ steps.checks.outputs.tag }}"
407394
version="${{ steps.checks.outputs.version }}"
@@ -413,7 +400,4 @@ jobs:
413400
414401
# Post release message to Discord
415402
# curl -X POST -H "Content-Type: application/json" -d "{\"embeds\": [{\"title\": \"New \`${{ matrix.package }}\` release! 🎉\", \"url\": \"https://www.npmjs.com/package/${{ matrix.package }}/v/$version\", \"color\": \"12907856\", \"fields\": [{\"name\": \"Version\", \"value\": \"\`$version\`\"}, {\"name\": \"Tag\", \"value\": \"\`$tag\`\"}]}]}" ${{ secrets.DISCORD_DEV_RELEASE_WEBHOOK_URL }}
416-
working-directory: ${{ matrix.package }}
417-
shell: bash
418-
env:
419-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
403+

.github/workflows/release-latest.yaml

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ jobs:
287287
run: bunx attw package.tgz
288288

289289
release:
290-
permissions: write-all
290+
permissions:
291+
contents: read
292+
id-token: write
291293
needs:
292294
- test
293295
- attw
@@ -304,6 +306,10 @@ jobs:
304306
- drizzle-arktype
305307
- eslint-plugin-drizzle
306308
runs-on: ubuntu-22.04
309+
# force empty so npm can use OIDC
310+
env:
311+
NODE_AUTH_TOKEN: ""
312+
NPM_TOKEN: ""
307313
services:
308314
postgres-postgis:
309315
image: postgis/postgis:16-3.4
@@ -357,36 +363,20 @@ jobs:
357363
ports:
358364
- 33306:3306
359365
steps:
360-
- uses: actions/checkout@v4
361-
362-
- uses: actions/setup-node@v4
363-
with:
364-
node-version: '22'
365-
registry-url: 'https://registry.npmjs.org'
366-
367-
- uses: pnpm/action-setup@v3
368-
name: Install pnpm
369-
id: pnpm-install
370-
with:
371-
version: latest
372-
run_install: false
373-
374-
- name: Get pnpm store directory
375-
id: pnpm-cache
376-
shell: bash
377-
run: |
378-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
379-
380-
- uses: actions/cache@v4
381-
name: Setup pnpm cache
382-
with:
383-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
384-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
385-
restore-keys: |
386-
${{ runner.os }}-pnpm-store-
387-
388-
- name: Install dependencies
389-
run: pnpm install
366+
- uses: actions/checkout@v5
367+
- uses: pnpm/action-setup@v4
368+
with: { run_install: false }
369+
- uses: actions/setup-node@v6
370+
with: { node-version: '24', cache: 'pnpm', cache-dependency-path: pnpm-lock.yaml }
371+
- run: pnpm install --frozen-lockfile --prefer-offline
372+
373+
# >= 11.5.1 for trusted publishing
374+
- name: Update NPM
375+
run: npm install -g npm@latest
376+
377+
# nuke, so npm can use OIDC
378+
- name: Remove temp npmrc
379+
run: rm -f "$NPM_CONFIG_USERCONFIG"
390380

391381
- name: Check preconditions
392382
id: checks
@@ -399,7 +389,6 @@ jobs:
399389
400390
if [[ "$is_version_published" == "true" ]]; then
401391
echo "\`${{ matrix.package }}@$version\` already published, adding tag \`latest\`" >> $GITHUB_STEP_SUMMARY
402-
npm dist-tag add ${{ matrix.package }}@$version latest
403392
elif [[ "$latest" != "$version" ]]; then
404393
echo "Latest: $latest"
405394
echo "Current: $version"
@@ -433,16 +422,12 @@ jobs:
433422
if: steps.checks.outputs.has_new_release == 'true'
434423
working-directory: ${{ matrix.package }}
435424
shell: bash
436-
env:
437-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
438425
run: npm run pack
439-
426+
440427
- name: Publish
441428
if: steps.checks.outputs.has_new_release == 'true'
442429
working-directory: ${{ matrix.package }}
443430
shell: bash
444-
env:
445-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
446431
run: |
447432
version="${{ steps.checks.outputs.version }}"
448433

changelogs/drizzle-kit/0.31.7.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Bug fixes
2+
3+
- [[BUG]: Drizzle Kit push to Postgres 18 produces unecessary DROP SQL when the schema was NOT changed](https://github.com/drizzle-team/drizzle-orm/issues/4944)

drizzle-kit/src/serializer/pgSerializer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,8 @@ WHERE
12881288
WHERE
12891289
tc.table_name = '${tableName}'
12901290
AND tc.constraint_schema = '${tableSchema}'
1291-
AND tc.constraint_type = 'CHECK';`);
1291+
AND tc.constraint_type = 'CHECK'
1292+
AND con.contype = 'c';`);
12921293

12931294
columnsCount += tableResponse.length;
12941295
if (progressCallback) {

0 commit comments

Comments
 (0)