mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | Type | Update | |---|---|---|---|---|---|---|---| | [@ai-sdk/google](https://ai-sdk.dev/docs) ([source](https://redirect.github.com/vercel/ai)) | [`1.2.15` -> `1.2.16`](https://renovatebot.com/diffs/npm/@ai-sdk%2fgoogle/1.2.15/1.2.16) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | dependencies | patch | | [@aws-sdk/client-s3](https://redirect.github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3) ([source](https://redirect.github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-s3)) | [`3.803.0` -> `3.804.0`](https://renovatebot.com/diffs/npm/@aws-sdk%2fclient-s3/3.803.0/3.804.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | dependencies | minor | | [@aws-sdk/s3-request-presigner](https://redirect.github.com/aws/aws-sdk-js-v3/tree/main/packages/s3-request-presigner) ([source](https://redirect.github.com/aws/aws-sdk-js-v3/tree/HEAD/packages/s3-request-presigner)) | [`3.803.0` -> `3.804.0`](https://renovatebot.com/diffs/npm/@aws-sdk%2fs3-request-presigner/3.803.0/3.804.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | dependencies | minor | | [@types/node](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)) | [`22.15.12` -> `22.15.14`](https://renovatebot.com/diffs/npm/@types%2fnode/22.15.12/22.15.14) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | dependencies | patch | | [@types/node](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)) | [`22.15.12` -> `22.15.14`](https://renovatebot.com/diffs/npm/@types%2fnode/22.15.12/22.15.14) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | devDependencies | patch | | [ai](https://ai-sdk.dev/docs) ([source](https://redirect.github.com/vercel/ai)) | [`4.3.13` -> `4.3.14`](https://renovatebot.com/diffs/npm/ai/4.3.13/4.3.14) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | dependencies | patch | | [slackapi/slack-github-action](https://redirect.github.com/slackapi/slack-github-action) | `v2.0.0` -> `v2.1.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | action | minor | | [com.android.tools.build:gradle](https://developer.android.com/studio/build) ([source](https://android.googlesource.com/platform/tools/base)) | `8.9.2` -> `8.10.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | dependencies | minor | | [com.android.library](https://developer.android.com/studio/build) ([source](https://android.googlesource.com/platform/tools/base)) | `8.9.2` -> `8.10.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | plugin | minor | | [com.android.application](https://developer.android.com/studio/build) ([source](https://android.googlesource.com/platform/tools/base)) | `8.9.2` -> `8.10.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | plugin | minor | --- ### Release Notes <details> <summary>vercel/ai (@​ai-sdk/google)</summary> ### [`v1.2.16`](https://redirect.github.com/vercel/ai/releases/tag/%40ai-sdk/google%401.2.16) [Compare Source](https://redirect.github.com/vercel/ai/compare/@ai-sdk/google@1.2.15...@ai-sdk/google@1.2.16) ##### Patch Changes - [`0ca6f2f`](https://redirect.github.com/vercel/ai/commit/0ca6f2f): feat(providers/google): add gemini-2.5-pro-preview-05-06 </details> <details> <summary>aws/aws-sdk-js-v3 (@​aws-sdk/client-s3)</summary> ### [`v3.804.0`](https://redirect.github.com/aws/aws-sdk-js-v3/blob/HEAD/clients/client-s3/CHANGELOG.md#38040-2025-05-06) [Compare Source](https://redirect.github.com/aws/aws-sdk-js-v3/compare/v3.803.0...v3.804.0) **Note:** Version bump only for package [@​aws-sdk/client-s3](https://redirect.github.com/aws-sdk/client-s3) </details> <details> <summary>aws/aws-sdk-js-v3 (@​aws-sdk/s3-request-presigner)</summary> ### [`v3.804.0`](https://redirect.github.com/aws/aws-sdk-js-v3/blob/HEAD/packages/s3-request-presigner/CHANGELOG.md#38040-2025-05-06) [Compare Source](https://redirect.github.com/aws/aws-sdk-js-v3/compare/v3.803.0...v3.804.0) **Note:** Version bump only for package [@​aws-sdk/s3-request-presigner](https://redirect.github.com/aws-sdk/s3-request-presigner) </details> <details> <summary>slackapi/slack-github-action (slackapi/slack-github-action)</summary> ### [`v2.1.0`](https://redirect.github.com/slackapi/slack-github-action/compare/v2.0.0...v2.1.0) [Compare Source](https://redirect.github.com/slackapi/slack-github-action/compare/v2.0.0...v2.1.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjQuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI2NC4wIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
187 lines
7.3 KiB
YAML
187 lines
7.3 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
flavor:
|
|
description: 'Select what enverionment to deploy to'
|
|
type: choice
|
|
default: canary
|
|
options:
|
|
- canary
|
|
- beta
|
|
- stable
|
|
- internal
|
|
|
|
permissions:
|
|
contents: 'write'
|
|
id-token: 'write'
|
|
packages: 'write'
|
|
|
|
jobs:
|
|
output-prev-version:
|
|
name: Output previous version
|
|
runs-on: ubuntu-latest
|
|
environment: ${{ github.event.inputs.flavor }}
|
|
outputs:
|
|
prev: ${{ steps.print.outputs.version }}
|
|
namespace: ${{ steps.print.outputs.namespace }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Auth to Cluster
|
|
uses: './.github/actions/cluster-auth'
|
|
with:
|
|
gcp-project-number: ${{ secrets.GCP_PROJECT_NUMBER }}
|
|
gcp-project-id: ${{ secrets.GCP_PROJECT_ID }}
|
|
service-account: ${{ secrets.GCP_HELM_DEPLOY_SERVICE_ACCOUNT }}
|
|
cluster-name: ${{ secrets.GCP_CLUSTER_NAME }}
|
|
cluster-location: ${{ secrets.GCP_CLUSTER_LOCATION }}
|
|
- name: Output previous version
|
|
id: print
|
|
run: |
|
|
namespace=""
|
|
if [ "${{ github.event.inputs.flavor }}" = "canary" ]; then
|
|
namespace="dev"
|
|
elif [ "${{ github.event.inputs.flavor }}" = "beta" ]; then
|
|
namespace="beta"
|
|
elif [ "${{ github.event.inputs.flavor }}" = "stable" ]; then
|
|
namespace="production"
|
|
else
|
|
echo "Invalid flavor: ${{ github.event.inputs.flavor }}"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Namespace set to: $namespace"
|
|
|
|
# Get the previous version from the deployment
|
|
prev_version=$(kubectl get deployment -n $namespace affine-graphql -o=jsonpath='{.spec.template.spec.containers[0].image}' | awk -F '-' '{print $3}')
|
|
|
|
echo "Previous version: $prev_version"
|
|
echo "version=$prev_version" >> $GITHUB_OUTPUT
|
|
echo "namesapce=$namespace" >> $GITHUB_OUTPUT
|
|
|
|
build-images:
|
|
name: Build Images
|
|
uses: ./.github/workflows/build-images.yml
|
|
secrets: inherit
|
|
with:
|
|
flavor: ${{ github.event.inputs.flavor }}
|
|
|
|
deploy:
|
|
name: Deploy to cluster
|
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
environment: ${{ github.event.inputs.flavor }}
|
|
needs:
|
|
- build-images
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Version
|
|
id: version
|
|
uses: ./.github/actions/setup-version
|
|
- name: Deploy to ${{ github.event.inputs.flavor }}
|
|
uses: ./.github/actions/deploy
|
|
with:
|
|
build-type: ${{ github.event.inputs.flavor }}
|
|
gcp-project-number: ${{ secrets.GCP_PROJECT_NUMBER }}
|
|
gcp-project-id: ${{ secrets.GCP_PROJECT_ID }}
|
|
service-account: ${{ secrets.GCP_HELM_DEPLOY_SERVICE_ACCOUNT }}
|
|
cluster-name: ${{ secrets.GCP_CLUSTER_NAME }}
|
|
cluster-location: ${{ secrets.GCP_CLUSTER_LOCATION }}
|
|
env:
|
|
APP_VERSION: ${{ steps.version.outputs.APP_VERSION }}
|
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
CANARY_DEPLOY_HOST: ${{ secrets.CANARY_DEPLOY_HOST }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
|
|
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
|
|
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
|
|
GCLOUD_CONNECTION_NAME: ${{ secrets.GCLOUD_CONNECTION_NAME }}
|
|
REDIS_SERVER_HOST: ${{ secrets.REDIS_SERVER_HOST }}
|
|
REDIS_SERVER_PASSWORD: ${{ secrets.REDIS_SERVER_PASSWORD }}
|
|
CLOUD_SQL_IAM_ACCOUNT: ${{ secrets.CLOUD_SQL_IAM_ACCOUNT }}
|
|
APP_IAM_ACCOUNT: ${{ secrets.APP_IAM_ACCOUNT }}
|
|
STATIC_IP_NAME: ${{ secrets.STATIC_IP_NAME }}
|
|
|
|
deploy-done:
|
|
needs:
|
|
- output-prev-version
|
|
- build-images
|
|
- deploy
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
name: Post deploy message
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
repository: toeverything/blocksuite
|
|
path: blocksuite
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
extra-flags: 'workspaces focus @affine/changelog'
|
|
electron-install: false
|
|
- name: Output deployed info
|
|
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
|
|
id: set_info
|
|
run: |
|
|
if [ "${{ github.event.inputs.flavor }}" = "canary" ]; then
|
|
echo "deployed_url=https://affine.fail" >> $GITHUB_OUTPUT
|
|
elif [ "${{ github.event.inputs.flavor }}" = "beta" ]; then
|
|
echo "deployed_url=https://insider.affine.pro" >> $GITHUB_OUTPUT
|
|
elif [ "${{ github.event.inputs.flavor }}" = "stable" ]; then
|
|
echo "deployed_url=https://app.affine.pro" >> $GITHUB_OUTPUT
|
|
else
|
|
exit 1
|
|
fi
|
|
env:
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
- name: Post Success event to a Slack channel
|
|
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
|
|
run: node ./tools/changelog/index.js
|
|
env:
|
|
CHANNEL_ID: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }}
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
DEPLOYED_URL: ${{ steps.set_info.outputs.deployed_url }}
|
|
PREV_VERSION: ${{ needs.output-prev-version.outputs.prev }}
|
|
NAMESPACE: ${{ needs.output-prev-version.outputs.namespace }}
|
|
DEPLOYMENT: 'SERVER'
|
|
FLAVOR: ${{ github.event.inputs.flavor }}
|
|
BLOCKSUITE_REPO_PATH: ${{ github.workspace }}/blocksuite
|
|
- name: Post Failed event to a Slack channel
|
|
id: failed-slack
|
|
uses: slackapi/slack-github-action@v2.1.0
|
|
if: ${{ always() && contains(needs.*.result, 'failure') }}
|
|
with:
|
|
method: chat.postMessage
|
|
token: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
payload: |
|
|
channel: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }}
|
|
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy failed `${{ github.event.inputs.flavor }}`>"
|
|
blocks:
|
|
- type: section
|
|
text:
|
|
type: mrkdwn
|
|
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy failed `${{ github.event.inputs.flavor }}`>"
|
|
- name: Post Cancel event to a Slack channel
|
|
id: cancel-slack
|
|
uses: slackapi/slack-github-action@v2.1.0
|
|
if: ${{ always() && contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') }}
|
|
with:
|
|
token: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
method: chat.postMessage
|
|
payload: |
|
|
channel: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }}
|
|
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy cancelled `${{ github.event.inputs.flavor }}`>"
|
|
blocks:
|
|
- type: section
|
|
text:
|
|
type: mrkdwn
|
|
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy cancelled `${{ github.event.inputs.flavor }}`>"
|