From 63ce44da585cb1cf481aa750ea0b0086f2db3494 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 7 Jun 2023 13:54:54 +0100 Subject: [PATCH] Handle versioning on single image pipeline --- .github/workflows/release-singleimage.yml | 32 ++++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index fbf972a866..a64465a860 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -5,7 +5,7 @@ on: env: CI: true - PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }} + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} REGISTRY_URL: registry.hub.docker.com jobs: build: @@ -32,7 +32,7 @@ jobs: echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" exit 1 fi - + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -44,10 +44,34 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Run Yarn run: yarn - - name: Run Yarn Bootstrap - run: yarn bootstrap + - name: Update versions + run: | + version=$(cat lerna.json \ + | grep version \ + | head -1 \ + | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ + | sed 's/[",]//g') + echo "Setting version $version" + yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" + echo "Updating dependencies" + node scripts/syncLocalDependencies.js $version + echo "Syncing yarn workspace" + yarn - name: Runt Yarn Lint run: yarn lint + - name: Update versions + run: | + version=$(cat lerna.json \ + | grep version \ + | head -1 \ + | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ + | sed 's/[",]//g') + echo "Setting version $version" + yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" + echo "Updating dependencies" + node scripts/syncLocalDependencies.js $version + echo "Syncing yarn workspace" + yarn - name: Run Yarn Build run: yarn build:docker:pre - name: Login to Docker Hub