From acc193aa878b146614196c936c2a1ab1a02e30ca Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 9 Mar 2023 16:33:48 +0000 Subject: [PATCH] Replace get previous tag with package version (#9968) --- .github/workflows/deploy-preprod.yml | 23 +++++++++++++++++------ .github/workflows/release-master.yml | 21 ++++++++++++--------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy-preprod.yml b/.github/workflows/deploy-preprod.yml index 803dd6af52..2d06212765 100644 --- a/.github/workflows/deploy-preprod.yml +++ b/.github/workflows/deploy-preprod.yml @@ -1,6 +1,10 @@ name: "deploy-preprod" on: workflow_dispatch: + inputs: + version: + description: Budibase release version. For example - 1.0.0 + required: false workflow_call: jobs: @@ -8,9 +12,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: 'Get Previous tag' - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@v1" + + - name: Get the latest budibase release version + id: version + run: | + if [ -z "${{ github.event.inputs.version }}" ]; then + release_version=$(cat lerna.json | jq -r '.version') + else + release_version=${{ github.event.inputs.version }} + fi + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 @@ -37,7 +48,7 @@ jobs: helm: helm3 values: | globals: - appVersion: ${{ steps.previoustag.outputs.tag }} + appVersion: ${{ env.RELEASE_VERSION }} ingress: enabled: true nginx: true @@ -52,5 +63,5 @@ jobs: uses: tsickert/discord-webhook@v4.0.0 with: webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} - content: "Preprod Deployment Complete: ${{ steps.previoustag.outputs.tag }} deployed to Budibase Pre-prod." - embed-title: ${{ steps.previoustag.outputs.tag }} \ No newline at end of file + content: "Preprod Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Pre-prod." + embed-title: ${{ env.RELEASE_VERSION }} \ No newline at end of file diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 3ae265fa21..20a48f5802 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -91,9 +91,11 @@ jobs: uses: azure/setup-helm@v1 id: helm-install - - name: 'Get Previous tag' - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@v1" + - name: Get the latest budibase release version + id: version + run: | + release_version=$(cat lerna.json | jq -r '.version') + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV # due to helm repo index issue: https://github.com/helm/helm/issues/7363 # we need to create new package in a different dir, merge the index and move the package back @@ -116,8 +118,6 @@ jobs: git add -A git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}" git push - env: - RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} deploy-to-legacy-preprod-env: needs: [release-images] @@ -130,13 +130,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: 'Get Previous tag' - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@v1" + + - name: Get the latest budibase release version + id: version + run: | + release_version=$(cat lerna.json | jq -r '.version') + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - uses: passeidireto/trigger-external-workflow-action@main env: - PAYLOAD_VERSION: ${{ steps.previoustag.outputs.tag }} + PAYLOAD_VERSION: ${{ env.RELEASE_VERSION }} with: repository: budibase/budibase-deploys event: budicloud-preprod-deploy