Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions .github/workflows/deploy-staging-and-prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches:
# Matches release branches
- "[0-9]+.[0-9]+"
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down Expand Up @@ -53,8 +52,7 @@ jobs:
checks: write
outputs:
MINOR_VERSION: ${{ env.MINOR_VERSION }}
CUSTOM_VERSION: ${{ env.CUSTOM_VERSION || env.BRANCH_NAME }}
BRANCH_NAME: ${{ env.BRANCH_NAME }}
CUSTOM_VERSION: ${{ env.CUSTOM_VERSION || env.VERSION }}
env:
## backward compatibility for older versions
APPS_MARKETPLACE_API_URI: "https://apps.staging.saleor.io/api/v2/saleor-apps"
Expand All @@ -71,28 +69,35 @@ jobs:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APPS_MARKETPLACE_API_URL: "https://apps.staging.saleor.io/api/v2/saleor-apps"
EXTENSIONS_API_URL: "https://apps.staging.saleor.io/api/v1/extensions"
BRANCH_NAME: ${{ github.event.inputs.git_ref || github.ref_name }}
VERSION: ${{ github.event.inputs.git_ref || github.ref_name }}
IS_CLOUD_INSTANCE: true
ENABLED_SERVICE_NAME_HEADER: true
ONBOARDING_USER_JOINED_DATE_THRESHOLD: ${{ vars.STAGING_ONBOARDING_USER_JOINED_DATE_THRESHOLD }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
ref: ${{ env.VERSION }}

- name: Set env variables
- name: Set environment
# Convert version into staging deployment name (e.g 3.3.0 -> saleor-staging-v33)
run: |
set -x
environment=$(echo $VERSION | sed -n 's#\([0-9]\+\).\([0-9]\+\).*#saleor-staging-v\1\2#p')
echo "ENVIRONMENT=${environment}" >> "$GITHUB_ENV"

- name: Set custom version
env:
VERSION: ${{ github.event.inputs.git_ref || github.ref_name }}
# Add commit hash to basic version number
run: |
set -x
HASH=$(git rev-parse --short HEAD)
CURRENT_VERSION=$(jq -r .version package.json)
RELEASE="${CURRENT_VERSION}-${HASH}"
MINOR_VERSION=$(echo "${RELEASE}" | sed -E 's/^([0-9]+\.[0-9]+)\..*/\1/')
ENVIRONMENT=$(echo "saleor-staging-v${MINOR_VERSION//./}")
echo "MINOR_VERSION=${MINOR_VERSION}" >> "$GITHUB_ENV"
echo "CUSTOM_VERSION=${RELEASE}" >> "$GITHUB_ENV"
echo "SENTRY_RELEASE=${RELEASE}" >> "$GITHUB_ENV"
echo "ENVIRONMENT=${ENVIRONMENT}" >> "$GITHUB_ENV"
echo "BRANCH_NAME=${BRANCH_NAME}" >> "$GITHUB_ENV"
minor_version=$(echo "$VERSION" | sed -n 's#\([0-9]\+\).\([0-9]\+\).*#\1.\2#p')
echo "MINOR_VERSION=${minor_version}" >> "$GITHUB_ENV"

- name: Setup Node
uses: actions/setup-node@v3
Expand All @@ -104,7 +109,7 @@ jobs:
id: create-check
uses: ./.github/actions/checks/create-pull-request-check
with:
PR_HEAD: "changeset-release/${{env.BRANCH_NAME}}"
PR_HEAD: "changeset-release/${{env.MINOR_VERSION}}"
CHECK_NAME: "Deploy_staging"
STATUS: "in_progress"
TITLE: "Deploy staging"
Expand Down Expand Up @@ -159,7 +164,7 @@ jobs:
JOB_STATUS: ${{ job.status }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLOUD_DEPLOYMENTS_WEBHOOK_URL }}
SLACK_MENTION_GROUP_ID: ${{ secrets.SLACK_DASHBOARD_GROUP_ID }}
JOB_TITLE: "Dashboard deployment of ${{ env.CUSTOM_VERSION || env.BRANCH_NAME }} to ${{ env.ENVIRONMENT }}"
JOB_TITLE: "Dashboard deployment of ${{ env.CUSTOM_VERSION || env.VERSION }} to ${{ env.ENVIRONMENT }}"
run: |
python3 ./.github/workflows/notify/notify-slack.py

Expand Down Expand Up @@ -189,5 +194,4 @@ jobs:
with:
VERSION: ${{ needs.build.outputs.MINOR_VERSION }} # eg. "3.19"
CUSTOM_VERSION: ${{ needs.build.outputs.CUSTOM_VERSION }} # eg. "3.19.4-5a41d18"
BRANCH_NAME: ${{ needs.build.outputs.BRANCH_NAME }}
secrets: inherit
10 changes: 2 additions & 8 deletions .github/workflows/run-tests-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ on:
type: string
required: false
default: "Dashboard Automation test run "
BRANCH_NAME:
type: string
required: false
description: Branch name for finding release PR

secrets:
STAGING_TOKEN:
Expand Down Expand Up @@ -51,7 +47,6 @@ jobs:
env:
VERSION: ${{inputs.VERSION}}
CUSTOM_VERSION: ${{inputs.CUSTOM_VERSION}}
BRANCH_NAME: ${{inputs.BRANCH_NAME}}
outputs:
VERSION: ${{ env.VERSION }}
POOL_NAME: ${{ steps.pool_variables.outputs.POOL_NAME }}
Expand All @@ -65,7 +60,6 @@ jobs:
IS_OLD_VERSION: ${{ steps.get-environment-variables.outputs.IS_OLD_VERSION }}
ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}
SALEOR_CLOUD_SERVICE: ${{ steps.cloud_variables.outputs.SALEOR_CLOUD_SERVICE }}
BRANCH_NAME: ${{ env.BRANCH_NAME }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -93,7 +87,7 @@ jobs:
id: create-check
uses: ./.github/actions/checks/create-pull-request-check
with:
PR_HEAD: "changeset-release/${{env.BRANCH_NAME || env.VERSION}}"
PR_HEAD: "changeset-release/${{env.VERSION}}"
CHECK_NAME: "Automation_tests_run"
STATUS: "in_progress"
TITLE: "Automation tests run"
Expand Down Expand Up @@ -160,7 +154,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.add-check-and-prepare-instance.outputs.BRANCH_NAME }}
ref: ${{ needs.add-check-and-prepare-instance.outputs.VERSION }}

- name: Run playwright tests
uses: ./.github/actions/run-pw-tests
Expand Down
Loading