From 649358fae1f8165e4ff42a11241023af8fa5266c Mon Sep 17 00:00:00 2001 From: Soare Robert Daniel Date: Thu, 29 Aug 2024 14:15:11 +0300 Subject: [PATCH] chore: use commit version in dev build (#339) --- .github/workflows/create-build-zip.yml | 10 ++++++++-- package.json | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-build-zip.yml b/.github/workflows/create-build-zip.yml index 467caebc..41300430 100644 --- a/.github/workflows/create-build-zip.yml +++ b/.github/workflows/create-build-zip.yml @@ -2,7 +2,7 @@ name: Build and publish the ZIP build file on: pull_request: - types: [ opened, synchronize, ready_for_review ] + types: [opened, synchronize, ready_for_review] branches-ignore: - "update_dependencies" concurrency: @@ -18,7 +18,7 @@ jobs: git-sha-8: ${{ steps.retrieve-git-sha-8.outputs.sha8 }} steps: - name: Check out source files - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get Composer Cache Directory id: composer-cache run: | @@ -36,6 +36,12 @@ jobs: run: yarn install --frozen-lockfile - name: Build files run: yarn run build + - name: Bump the plugin version + run: | + CURRENT_VERSION=$(node -p -e "require('./package.json').version") + COMMIT_HASH=$(git rev-parse --short HEAD) + DEV_VERSION="${CURRENT_VERSION}-dev.${COMMIT_HASH}" + npm run grunt version::${DEV_VERSION} - name: Create zip run: yarn run dist - name: Retrieve branch name diff --git a/package.json b/package.json index 56062bc3..838dfa27 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "dist": "bash ./bin/dist.sh", "release": "npx semantic-release", "build:makepot": "bash ./bin/makepot.sh", - "build:grunt": "grunt build" + "build:grunt": "grunt build", + "grunt": "grunt" } }