From fff6568063bfa2a995d84fb2cf70828300898c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20M=C5=82odzikowski?= Date: Thu, 13 Jul 2023 16:10:07 +0200 Subject: [PATCH] feat(ci): provide fixes for releasing individual apps --- .github/workflows/ci-cd-trigger.yml | 10 +++++++++- .github/workflows/publish-dist.yml | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-cd-trigger.yml b/.github/workflows/ci-cd-trigger.yml index 9842705b5..851bfcaf6 100644 --- a/.github/workflows/ci-cd-trigger.yml +++ b/.github/workflows/ci-cd-trigger.yml @@ -107,6 +107,7 @@ jobs: echo "NX_HEAD: ${{ env.NX_HEAD }}" echo "Affected: ${affected}" echo "Branch slug: ${branch_slug}" + echo "Current ref: ${{ github.ref }}" echo ">>>> eof debug" projects_array=() @@ -178,20 +179,27 @@ jobs: fi # if branch starts with release/ and ends with trading / governance or explorer - overwrite the array of affected projects with fixed single application - if [[ "${{ github.ref }}" == release* ]]; then + if [[ "${{ github.ref }}" == *release* ]]; then + echo ">> This is a relase branch" case "${{ github.ref }}" in *trading) + echo ">> Only trading will be deployed" projects_array=(trading) projects_e2e_array=(trading) ;; *governance) + echo ">> Only governance will be deployed" projects_array=(governance) projects_e2e_array=(governance) ;; *explorer) + echo ">> Only explorer will be deployed" projects_array=(explorer) projects_e2e_array=(explorer) ;; + *) + echo ">> All apps will be deployed" + ;; esac fi diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 51c7466de..ef17f00cf 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -97,7 +97,7 @@ jobs: if [[ "${{ github.ref }}" =~ .*release/.* ]]; then # remove prefixing release/ and take the first string limited by - which is supposed to be name of the environment for releasing (format: release/testnet-trading) - envName="$(echo ${{ github.ref }} | sed -e "s|release/||" | cut -d '-' -f 1 )" + envName="$(echo ${{ github.ref }} | sed -e "s|refs/heads/release/||" | cut -d '-' -f 1 )" elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then envName="stagnet1" if [[ "${{ matrix.app }}" = "multisig-signer" ]]; then @@ -112,7 +112,7 @@ jobs: envName="mainnet" bucketName="ui.vega.rocks" fi - elif [[ "${{ github.ref }}" =~ .*main$ ]]; then + elif [[ "${{ github.ref }}" =~ .*mainnet$ ]]; then envName="mainnet" fi @@ -282,7 +282,7 @@ jobs: # release to ipfs happens only on mainnet (represented by main branch) for trading if: ${{ env.IS_IPFS_RELEASE == 'true' }} run: | - if echo ${{ github.ref }} | grep -q main; then + if [[ "${{ env.IS_MAINNET_RELEASE }}" = "true" ]]; then # display info about app curl --fail -H "Authorization: ${{ secrets.FLEEK_API_KEY }}" \ -H "Content-Type: application/json" \ @@ -295,7 +295,7 @@ jobs: -d '{"query": "mutation{triggerDeploy(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id status}}"}' \ https://api.fleek.co/graphql - elif echo ${{ github.ref }} | grep -q release/testnet; then + elif [[ "${{ env.IS_TESTNET_RELEASE }}" = "true" ]]; then # display info about app curl --fail -H "Authorization: ${{ secrets.FLEEK_API_KEY }}" \ -H "Content-Type: application/json" \