From ca5ea315d69689b2cb0e4b7a3919c9d64d84608e Mon Sep 17 00:00:00 2001 From: Matti Nannt Date: Tue, 18 Mar 2025 11:49:12 +0100 Subject: [PATCH] chore: determine formbricks version on release (#4985) --- .github/workflows/prepare-release.yml | 67 --------------------- .github/workflows/release-docker-github.yml | 12 ++++ .github/workflows/release-docker.yml | 19 +++--- apps/web/package.json | 2 +- 4 files changed, 25 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/prepare-release.yml diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml deleted file mode 100644 index c2ad9307f2..0000000000 --- a/.github/workflows/prepare-release.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Prepare release -run-name: Prepare release ${{ inputs.next_version }} - -on: - workflow_dispatch: - inputs: - next_version: - required: true - type: string - description: "Version name" - -permissions: - contents: write - pull-requests: write - -jobs: - prepare_release: - runs-on: ubuntu-latest - - steps: - - name: Harden the runner (Audit all outbound calls) - uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 - with: - egress-policy: audit - - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - - uses: ./.github/actions/dangerous-git-checkout - - - name: Configure git - run: | - git config --local user.email "github-actions@github.com" - git config --local user.name "GitHub Actions" - - - name: Setup Node.js 20.x - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af - with: - node-version: 20.x - - - name: Install pnpm - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 - - - name: Install dependencies - run: pnpm install --config.platform=linux --config.architecture=x64 - - - name: Bump version - run: | - cd apps/web - pnpm version ${{ inputs.next_version }} --no-workspaces-update - - - name: Commit changes and create a branch - run: | - branch_name="release-v${{ inputs.next_version }}" - git checkout -b "$branch_name" - git add . - git commit -m "chore: release v${{ inputs.next_version }}" - git push origin "$branch_name" - - - name: Create pull request - run: | - gh pr create \ - --base main \ - --head "release-v${{ inputs.next_version }}" \ - --title "chore: bump version to v${{ inputs.next_version }}" \ - --body "This PR contains the changes for the v${{ inputs.next_version }} release." - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-docker-github.yml b/.github/workflows/release-docker-github.yml index d648ae6760..837dcfe4b5 100644 --- a/.github/workflows/release-docker-github.yml +++ b/.github/workflows/release-docker-github.yml @@ -42,6 +42,18 @@ jobs: - name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - name: Get Release Tag + id: extract_release_tag + run: | + TAG=${{ github.ref }} + TAG=${TAG#refs/tags/v} + echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV + + - name: Update package.json version + run: | + sed -i "s/\"version\": \"0.0.0\"/\"version\": \"${{ env.RELEASE_TAG }}\"/" ./apps/web/package.json + cat ./apps/web/package.json | grep version + - name: Set up Depot CLI uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1.6.0 diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 3f4c3680c7..d3367333ca 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -27,6 +27,18 @@ jobs: - name: Checkout Repo uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 + - name: Get Release Tag + id: extract_release_tag + run: | + TAG=${{ github.ref }} + TAG=${TAG#refs/tags/v} + echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV + + - name: Update package.json version + run: | + sed -i "s/\"version\": \"0.0.0\"/\"version\": \"${{ env.RELEASE_TAG }}\"/" ./apps/web/package.json + cat ./apps/web/package.json | grep version + - name: Log in to Docker Hub uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 with: @@ -36,13 +48,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0 - - name: Get Release Tag - id: extract_release_tag - run: | - TAG=${{ github.ref }} - TAG=${TAG#refs/tags/v} - echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV - - name: Build and push Docker image uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4.2.1 with: diff --git a/apps/web/package.json b/apps/web/package.json index 7a8e0245ef..cd9c7f17d2 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "@formbricks/web", - "version": "3.4.0", + "version": "0.0.0", "private": true, "scripts": { "clean": "rimraf .turbo node_modules .next",