From b67a73d83299014770ff44f072083a7f8ba9c387 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 7 Mar 2023 06:06:34 -0500 Subject: [PATCH] [ACA-4649] release workflow fixes (#3041) * release workflow fixes * fix release triggering on push to master * cleanup --- .github/actions/publish-image/action.yml | 4 ++-- .github/workflows/release.yml | 4 ++++ scripts/travis/deploy/publish.sh | 11 ++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/actions/publish-image/action.yml b/.github/actions/publish-image/action.yml index e8b566c19..233e3aa61 100644 --- a/.github/actions/publish-image/action.yml +++ b/.github/actions/publish-image/action.yml @@ -30,11 +30,11 @@ runs: shell: bash run: | if [[ "${{ inputs.branch_name }}" == "master" ]]; then - TAG_VERSION=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g') + TAG_VERSION=$(jq -cr '.version' < package.json) else TAG_VERSION=${{ inputs.branch_name }}-${{ github.run_id }} fi echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV - name: Publish image shell: bash - run: ./scripts/travis/deploy/publish.sh ${{ inputs.domain }} ${{ inputs.username }} ${{ inputs.password }} $TAG_VERSION ${{ inputs.branch_name }} ${{ inputs.dry-run }} + run: ./scripts/travis/deploy/publish.sh "${{ inputs.domain }}" "$REPO_SLUG" "${{ inputs.username }}" "${{ inputs.password }}" "$TAG_VERSION" "${{ inputs.branch_name }}" "${{ inputs.dry-run }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ccaf8d9d..41d44bba1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,9 @@ on: - master - develop-patch* - master-patch* + push: + branches: + - master env: APP_CONFIG_ECM_HOST: ${{ secrets.PIPELINE_ENV_URL }} @@ -37,6 +40,7 @@ env: APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: / APP_CONFIG_OAUTH2_REDIRECT_LOGIN: / APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: "{protocol}//{hostname}{:port}/assets/silent-refresh.html" + REPO_SLUG: "alfresco/alfresco-content-app" jobs: publish-docker-registry: diff --git a/scripts/travis/deploy/publish.sh b/scripts/travis/deploy/publish.sh index 0c390a791..85d7b7669 100755 --- a/scripts/travis/deploy/publish.sh +++ b/scripts/travis/deploy/publish.sh @@ -1,11 +1,12 @@ #!/bin/bash -e DOMAIN="$1" -USERNAME="$2" -PASSWORD="$3" -TAG_VERSION="$4" -BRANCH_NAME="$5" -DRY_RUN="$6" +REPO_SLUG="$2" +USERNAME="$3" +PASSWORD="$4" +TAG_VERSION="$5" +BRANCH_NAME="$6" +DRY_RUN="$7" npm ci && npm run build.release