Skip to content

Commit

Permalink
Merge pull request #1484 from drizzle-team/beta
Browse files Browse the repository at this point in the history
0.29.0
  • Loading branch information
AndriiSherman authored Nov 9, 2023
2 parents a7dc7e8 + a6dc062 commit 0d833d1
Show file tree
Hide file tree
Showing 272 changed files with 23,076 additions and 3,337 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ examples
**/*.js
**/*.mjs
**/*.cjs
**/playground
2 changes: 2 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rules:
- error
- disallowTypeAnnotations: false
fixStyle: separate-type-imports
'@typescript-eslint/no-import-type-side-effects': 'error'
import/no-cycle: error
import/no-self-import: error
import/no-empty-named-blocks: error
Expand Down Expand Up @@ -66,3 +67,4 @@ rules:
'@typescript-eslint/ban-ts-comment': 'off'
'@typescript-eslint/no-empty-interface': 'off'
'@typescript-eslint/no-unsafe-declaration-merging': 'off'
'no-inner-declarations': 'off'
63 changes: 48 additions & 15 deletions .github/workflows/release-feature-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,35 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Check preconditions
id: checks
shell: bash
working-directory: ${{ matrix.package }}
run: |
old_version="$(jq -r .version package.json)"
version="$old_version-$(git rev-parse --short HEAD)"
npm version $version
tag="${{ github.ref_name }}"
is_version_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"
if [[ "$is_version_published" == "true" ]]; then
echo "\`${{ matrix.package }}@$version\` already published, adding tag \`$tag\`" >> $GITHUB_STEP_SUMMARY
npm dist-tag add ${{ matrix.package }}@$version $tag
else
{
echo "version=$version"
echo "tag=$tag"
echo "has_new_release=true"
} >> $GITHUB_OUTPUT
fi
- name: Build
if: steps.checks.outputs.has_new_release == 'true'
run: |
pnpm build
- name: Run tests
if: steps.checks.outputs.has_new_release == 'true'
env:
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/drizzle
MYSQL_CONNECTION_STRING: mysql://root:root@localhost:3306/drizzle
Expand All @@ -99,28 +123,37 @@ jobs:
pnpm test --filter ${{ matrix.package }}
fi
- name: Pack
if: steps.checks.outputs.has_new_release == 'true'
working-directory: ${{ matrix.package }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
npm run pack
- name: Run @arethetypeswrong/cli
if: steps.checks.outputs.has_new_release == 'true'
working-directory: ${{ matrix.package }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
pnpm attw package.tgz
- name: Publish
if: github.event_name == 'push'
if: github.event_name == 'push' && steps.checks.outputs.has_new_release == 'true'
run: |
tag="${{ github.ref_name }}"
old_version="$(jq -r .version package.json)"
version="$old_version-$(git rev-parse --short HEAD)"
is_version_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"
tag="${{ steps.checks.outputs.tag }}"
version="${{ steps.checks.outputs.version }}"
if [[ "$is_version_published" == "true" ]]; then
echo "Version $version already published, adding tag $tag"
npm dist-tag add ${{ matrix.package }}@$version $tag
else
echo "Publishing ${{ matrix.package }}@$tag using version $version"
(cd dist && npm version $version)
npm run pack
npm run publish -- --tag $tag
fi
echo "Publishing ${{ matrix.package }}@$tag using version $version"
npm run publish -- --tag $tag
echo "npm: \`${{ matrix.package }}@$tag | ${{ matrix.package }}@$version\`" >> $GITHUB_STEP_SUMMARY
# Post release message to Discord
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 }}
# 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 }}
working-directory: ${{ matrix.package }}
shell: bash
env:
Expand Down
37 changes: 26 additions & 11 deletions .github/workflows/release-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ jobs:
run: |
latest="$(npm view --json ${{ matrix.package }} dist-tags.latest | jq -r)"
version="$(jq -r .version package.json)"
is_version_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"
if [[ "$latest" != "$version" ]]; then
if [[ "$is_version_published" == "true" ]]; then
echo "\`${{ matrix.package }}@$version\` already published, adding tag \`latest\`" >> $GITHUB_STEP_SUMMARY
npm dist-tag add ${{ matrix.package }}@$version latest
elif [[ "$latest" != "$version" ]]; then
echo "Latest: $latest"
echo "Current: $version"
Expand Down Expand Up @@ -119,6 +123,24 @@ jobs:
pnpm test --filter ${{ matrix.package }}
fi
- name: Pack
if: steps.checks.outputs.has_new_release == 'true'
working-directory: ${{ matrix.package }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
npm run pack
- name: Run @arethetypeswrong/cli
if: steps.checks.outputs.has_new_release == 'true'
working-directory: ${{ matrix.package }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
pnpm attw package.tgz
- name: Publish
if: steps.checks.outputs.has_new_release == 'true'
working-directory: ${{ matrix.package }}
Expand All @@ -127,21 +149,14 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
version="${{ steps.checks.outputs.version }}"
is_version_published="$(npm view ${{ matrix.package }} versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"
if [[ "$is_version_published" == "true" ]]; then
echo "Version $version already published, adding tag $tag"
npm dist-tag add ${{ matrix.package }}@$version latest
else
echo echo "Publishing ${{ matrix.package }}@$version"
npm run pack
npm run publish
fi
echo "Publishing ${{ matrix.package }}@$version"
npm run publish
echo "npm: \`+ ${{ matrix.package }}@$version\`" >> $GITHUB_STEP_SUMMARY
# Post release message to Discord
curl -X POST -H "Content-Type: application/json" -d "{\"embeds\": [{\"title\": \"New \`${{ matrix.package }}\` release! 🎉\", \"url\": \"https://www.npmjs.com/package/${{ matrix.package }}\", \"color\": \"12907856\", \"fields\": [{\"name\": \"Tag\", \"value\": \"\`$tag\`\"}]}]}" ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
# curl -X POST -H "Content-Type: application/json" -d "{\"embeds\": [{\"title\": \"New \`${{ matrix.package }}\` release! 🎉\", \"url\": \"https://www.npmjs.com/package/${{ matrix.package }}\", \"color\": \"12907856\", \"fields\": [{\"name\": \"Tag\", \"value\": \"\`$tag\`\"}]}]}" ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
- name: Create GitHub release for ORM package
uses: actions/github-script@v6
Expand Down
Loading

0 comments on commit 0d833d1

Please sign in to comment.