From a78b31987790619cf384ac102b9e13899b86c5a3 Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Fri, 5 Jun 2026 14:40:50 +0200 Subject: [PATCH] `sdk/v*` `twenty/v*` namespaces (#21247) # Introduction Removed never used release dispatch workflow Now assuming that anyone releasing will create both twenty and npm family tags Will create a workflow to ease this later We will now start to have several github releases, one per namespace --- .github/workflows/cd-deploy-tag.yaml | 31 ++++++++++-- .github/workflows/ci-release-merge.yaml | 63 ------------------------- 2 files changed, 28 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/ci-release-merge.yaml diff --git a/.github/workflows/cd-deploy-tag.yaml b/.github/workflows/cd-deploy-tag.yaml index 360cf0a35d5..8f8140188db 100644 --- a/.github/workflows/cd-deploy-tag.yaml +++ b/.github/workflows/cd-deploy-tag.yaml @@ -6,18 +6,43 @@ permissions: on: push: tags: - - 'v*' + - 'twenty/v*' + - 'sdk/v*' + +defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} jobs: - deploy-tag: + dispatch-tag: timeout-minutes: 3 runs-on: ubuntu-latest steps: + - name: Resolve dispatch event from tag family + id: target + env: + REF_NAME: ${{ github.ref_name }} + run: | + case "$REF_NAME" in + twenty/v*) + event_type=auto-deploy-twenty + ;; + sdk/v*) + event_type=auto-publish-npm + ;; + *) + echo "Unsupported tag '$REF_NAME', expected 'twenty/v*' or 'sdk/v*'." >&2 + exit 1 + ;; + esac + printf 'event_type=%s\n' "$event_type" >> "$GITHUB_OUTPUT" + - name: Repository Dispatch env: GH_TOKEN: ${{ secrets.TWENTY_INFRA_TOKEN }} + EVENT_TYPE: ${{ steps.target.outputs.event_type }} REF_NAME: ${{ github.ref_name }} run: | gh api repos/twentyhq/twenty-infra/dispatches \ - -f event_type=auto-deploy-tag \ + -f "event_type=$EVENT_TYPE" \ -f "client_payload[github][ref_name]=$REF_NAME" diff --git a/.github/workflows/ci-release-merge.yaml b/.github/workflows/ci-release-merge.yaml deleted file mode 100644 index 91b58523f98..00000000000 --- a/.github/workflows/ci-release-merge.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: "Release: on merge" - -permissions: - contents: write - -on: - pull_request: - types: - - closed - -defaults: - run: - shell: bash --noprofile --norc -euo pipefail {0} - -jobs: - tag_and_release: - timeout-minutes: 10 - runs-on: ubuntu-latest - if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') - steps: - - name: Check PR Author - id: check_author - env: - PR_AUTHOR: ${{ github.event.pull_request.user.login }} - run: | - set -euo pipefail - if [[ "$PR_AUTHOR" != "github-actions[bot]" ]]; then - echo "PR author ($PR_AUTHOR) is not trusted. Exiting." - exit 1 - fi - - - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - ref: main - - - name: Get version from PR title - id: extract_version - env: - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - set -euo pipefail - VERSION=$(printf '%s' "$PR_TITLE" | sed -n 's/.*Release v\([0-9][0-9.]*\).*/\1/p') - if [ -z "$VERSION" ]; then - echo "No valid version found in PR title. Exiting." - exit 1 - fi - printf 'VERSION=%s\n' "$VERSION" >> "$GITHUB_ENV" - - - name: Push new tag - run: | - set -euo pipefail - git config --global user.name 'Github Action Deploy' - git config --global user.email 'github-action-deploy@twenty.com' - git tag "v${{ env.VERSION }}" - git push origin "v${{ env.VERSION }}" - - - uses: release-drafter/release-drafter@09c613e259eb8d4e7c81c2cb00618eb5fc4575a7 # v5 - if: contains(github.event.pull_request.labels.*.name, 'create_release') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag: v${{ env.VERSION }}