From ced12ad9e2cd2e33dc7ae2bf2f21af1ae1ba5e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Fri, 18 Nov 2022 11:05:17 +0100 Subject: [PATCH 01/13] send message to slack with the release start --- .github/workflows/draft-new-release.yml | 27 +++++++++++++++++++++++++ clouds/bigquery/CHANGELOG.md | 6 ++++++ clouds/bigquery/version | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 93ddd82..46255e4 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -11,6 +11,8 @@ jobs: draft-new-release: name: "Draft a new release" runs-on: ubuntu-latest + outputs: + pr_url: ${{ steps.pull_request.outputs.pr_url }} steps: - uses: actions/checkout@v3 - name: Check if release tag exists @@ -101,3 +103,28 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} run: gh workflow run -R https://github.com/CartoDB/documentation.git update-doc.yml -f version=new-${{ github.event.inputs.version }} + + notify-slack: + runs-on: ubuntu-20.04 + name: "Notify Slack" + needs: + - draft-new-release + env: + RELEASE_VERSION: ${{ github.event.inputs.version }} + steps: + - name: Slack notification (#carto-selfhosted) + env: + SLACK_CHANNEL: CT77VDK0X #analytics-toolbox + SLACK_KEY: ${{ secrets.SLACK_KEY }} + PR_URL: ${{ needs.changelog.outputs.pr_url }} + run: | + set -eu + MESSAGE="This is a test message! + Analytics toolbox Release \`${RELEASE_VERSION}\` is ready to be reviewed, please review and merge the PR: + - *Status:* :white_check_mark: + - *<${PR_CHANGELOG}|Pull Request Analytics toolbox*" + curl \ + -F "text=${MESSAGE}" \ + -F "channel=${SLACK_CHANNEL}" \ + -H "Authorization: Bearer ${SLACK_KEY}" \ + -X POST https://slack.com/api/chat.postMessage \ No newline at end of file diff --git a/clouds/bigquery/CHANGELOG.md b/clouds/bigquery/CHANGELOG.md index 611b160..b5c9648 100644 --- a/clouds/bigquery/CHANGELOG.md +++ b/clouds/bigquery/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Changed + +- add nice stuff + ## [1.3.9] - 2022-11-15 ### Changed diff --git a/clouds/bigquery/version b/clouds/bigquery/version index 2fe9589..e21e727 100644 --- a/clouds/bigquery/version +++ b/clouds/bigquery/version @@ -1 +1 @@ -1.3.9 \ No newline at end of file +1.4.0 \ No newline at end of file From 7d2eef2e1585610c9ab6fc1ebebb679ddecc9bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Fri, 18 Nov 2022 11:06:53 +0100 Subject: [PATCH 02/13] send message to slack with the release start --- .github/workflows/draft-new-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 46255e4..14b4d1b 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -122,7 +122,7 @@ jobs: MESSAGE="This is a test message! Analytics toolbox Release \`${RELEASE_VERSION}\` is ready to be reviewed, please review and merge the PR: - *Status:* :white_check_mark: - - *<${PR_CHANGELOG}|Pull Request Analytics toolbox*" + - *<${PR_URL}|Pull Request Analytics toolbox*" curl \ -F "text=${MESSAGE}" \ -F "channel=${SLACK_CHANNEL}" \ From 71962411a500ddbdfc2ea649f690920e5d2786e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Fri, 18 Nov 2022 11:11:25 +0100 Subject: [PATCH 03/13] send message to slack with the release start --- .github/workflows/draft-new-release.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 14b4d1b..bbe7c73 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -116,15 +116,16 @@ jobs: env: SLACK_CHANNEL: CT77VDK0X #analytics-toolbox SLACK_KEY: ${{ secrets.SLACK_KEY }} - PR_URL: ${{ needs.changelog.outputs.pr_url }} + PR_URL: ${{ needs.draft-new-release.outputs.pr_url }} run: | set -eu MESSAGE="This is a test message! Analytics toolbox Release \`${RELEASE_VERSION}\` is ready to be reviewed, please review and merge the PR: - *Status:* :white_check_mark: - *<${PR_URL}|Pull Request Analytics toolbox*" - curl \ - -F "text=${MESSAGE}" \ - -F "channel=${SLACK_CHANNEL}" \ - -H "Authorization: Bearer ${SLACK_KEY}" \ - -X POST https://slack.com/api/chat.postMessage \ No newline at end of file + echo $MESSAGE + # curl \ + # -F "text=${MESSAGE}" \ + # -F "channel=${SLACK_CHANNEL}" \ + # -H "Authorization: Bearer ${SLACK_KEY}" \ + # -X POST https://slack.com/api/chat.postMessage \ No newline at end of file From 04829a3b703ec17924219d16e717be84c2096a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Fri, 18 Nov 2022 11:24:37 +0100 Subject: [PATCH 04/13] send message to slack with the release start --- .github/workflows/draft-new-release.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index bbe7c73..468cff5 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -114,18 +114,16 @@ jobs: steps: - name: Slack notification (#carto-selfhosted) env: - SLACK_CHANNEL: CT77VDK0X #analytics-toolbox + SLACK_CHANNEL: CRQT3HKCH #CT77VDK0X - analytics-toolbox SLACK_KEY: ${{ secrets.SLACK_KEY }} PR_URL: ${{ needs.draft-new-release.outputs.pr_url }} run: | set -eu - MESSAGE="This is a test message! - Analytics toolbox Release \`${RELEASE_VERSION}\` is ready to be reviewed, please review and merge the PR: + MESSAGE="Analytics toolbox Release \`${RELEASE_VERSION}\` is ready to be reviewed, please review and merge the PR: - *Status:* :white_check_mark: - - *<${PR_URL}|Pull Request Analytics toolbox*" - echo $MESSAGE - # curl \ - # -F "text=${MESSAGE}" \ - # -F "channel=${SLACK_CHANNEL}" \ - # -H "Authorization: Bearer ${SLACK_KEY}" \ - # -X POST https://slack.com/api/chat.postMessage \ No newline at end of file + - *<${PR_URL}|Pull Request Analytics toolbox>*" + curl \ + -F "text=${MESSAGE}" \ + -F "channel=${SLACK_CHANNEL}" \ + -H "Authorization: Bearer ${SLACK_KEY}" \ + -X POST https://slack.com/api/chat.postMessage \ No newline at end of file From 26baaa6032ec34e8232bf94d529918dd2d04d858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 13:23:31 +0100 Subject: [PATCH 05/13] commit with pat --- .github/workflows/draft-new-release.yml | 6 ++++-- .github/workflows/publish-release.yml | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 468cff5..6b1f19a 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -15,6 +15,8 @@ jobs: pr_url: ${{ steps.pull_request.outputs.pr_url }} steps: - uses: actions/checkout@v3 + with: + token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} - name: Check if release tag exists run: | if [[ $(git ls-remote --tags origin refs/tags/"${{ github.event.inputs.version }}") ]]; then @@ -114,12 +116,12 @@ jobs: steps: - name: Slack notification (#carto-selfhosted) env: - SLACK_CHANNEL: CRQT3HKCH #CT77VDK0X - analytics-toolbox + SLACK_CHANNEL: CRQT3HKCH #analytics-toolbox SLACK_KEY: ${{ secrets.SLACK_KEY }} PR_URL: ${{ needs.draft-new-release.outputs.pr_url }} run: | set -eu - MESSAGE="Analytics toolbox Release \`${RELEASE_VERSION}\` is ready to be reviewed, please review and merge the PR: + MESSAGE="Analytics toolbox Release \`${RELEASE_VERSION}\` is ready, please review and merge the PR: - *Status:* :white_check_mark: - *<${PR_URL}|Pull Request Analytics toolbox>*" curl \ diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 135dcfe..5cdfcfb 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -22,6 +22,8 @@ jobs: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/')) steps: - uses: actions/checkout@v3 + with: + token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} - name: Extract version from branch name (for release branches) if: startsWith(github.event.pull_request.head.ref, 'release/') run: | @@ -101,7 +103,7 @@ jobs: - name: Merge PR if possible env: - GH_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} run: | gh pr merge ${{ steps.pull_request.outputs.pr_number }} --auto --merge From 6c0178b507e5622cb6974cb07d49adc1980c8d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 13:55:13 +0100 Subject: [PATCH 06/13] commit with pat --- .github/workflows/draft-new-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 6b1f19a..9f8e915 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -72,7 +72,7 @@ jobs: uses: repo-sync/pull-request@v2 id: pull_request env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} with: source_branch: release/${{ github.event.inputs.version }} destination_branch: stable From 031b245bc63dd218f477823e64522a5ef71d3bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 15:48:12 +0100 Subject: [PATCH 07/13] commit with pat --- .github/workflows/draft-new-release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 9f8e915..f396a2b 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -63,11 +63,18 @@ jobs: run: | SF_VERSION=$(cat clouds/snowflake/version) sed -i "s/\[Unreleased\]/\[${SF_VERSION}\] - ${{ github.event.inputs.version }}/g" clouds/snowflake/CHANGELOG.md + - name: Set git config + run: | + git config --global user.email supercartofante@cartodb.com + git config --global user.name supercartofante - uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: Edit changelog versions branch: release/${{ github.event.inputs.version }} create_branch: true + commit_user_name: supercartofante + commit_user_email: supercartofante@cartodb.com + commit_author: supercartofante@cartodb.com - name: Create pull request uses: repo-sync/pull-request@v2 id: pull_request From cb1fadaccf2ba0270d836c618eb9c7a053cd502b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 15:51:12 +0100 Subject: [PATCH 08/13] commit with pat --- .github/workflows/draft-new-release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index f396a2b..d962ed4 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -63,10 +63,6 @@ jobs: run: | SF_VERSION=$(cat clouds/snowflake/version) sed -i "s/\[Unreleased\]/\[${SF_VERSION}\] - ${{ github.event.inputs.version }}/g" clouds/snowflake/CHANGELOG.md - - name: Set git config - run: | - git config --global user.email supercartofante@cartodb.com - git config --global user.name supercartofante - uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: Edit changelog versions @@ -74,7 +70,6 @@ jobs: create_branch: true commit_user_name: supercartofante commit_user_email: supercartofante@cartodb.com - commit_author: supercartofante@cartodb.com - name: Create pull request uses: repo-sync/pull-request@v2 id: pull_request From be6835aebcf040141101f1e4b5d213e7d61edeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 15:57:01 +0100 Subject: [PATCH 09/13] commit with pat --- .github/workflows/draft-new-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index d962ed4..dc50a0f 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -68,8 +68,8 @@ jobs: commit_message: Edit changelog versions branch: release/${{ github.event.inputs.version }} create_branch: true - commit_user_name: supercartofante - commit_user_email: supercartofante@cartodb.com + commit_user_name: Angel Arroyo + commit_user_email: aarroyo@cartodb.com - name: Create pull request uses: repo-sync/pull-request@v2 id: pull_request From a3b34a0b85448ea1e7fc2b9cbeefd98996863db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 16:47:55 +0100 Subject: [PATCH 10/13] commit with pat --- .github/workflows/publish-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5cdfcfb..c0d9b0e 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -94,7 +94,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - source_branch: stable + source_branch: ${{ github.event.pull_request.head.ref }} destination_branch: main pr_title: Merge master into dev branch pr_body: | @@ -111,7 +111,7 @@ jobs: needs: release if: needs.release.outputs.change_bq == 'true' name: "Publish AT for BigQuery" - uses: aarroyosal/AT-poc/.github/workflows/bigquery.yml@stable + uses: aarroyosal/AT-poc/.github/workflows/bigquery.yml@${{ github.event.pull_request.head.ref }} publish-db: needs: release From dff54e5128f402157e295e7cd65972110ddae421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 17:01:02 +0100 Subject: [PATCH 11/13] commit with pat --- .github/workflows/publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index c0d9b0e..50af56a 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -111,7 +111,7 @@ jobs: needs: release if: needs.release.outputs.change_bq == 'true' name: "Publish AT for BigQuery" - uses: aarroyosal/AT-poc/.github/workflows/bigquery.yml@${{ github.event.pull_request.head.ref }} + uses: aarroyosal/AT-poc/.github/workflows/bigquery.yml@stable publish-db: needs: release From 3f4244da6f5907e4f9b981bab75ab774e136c083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Arroyo?= Date: Mon, 21 Nov 2022 17:03:59 +0100 Subject: [PATCH 12/13] commit with pat --- .github/workflows/draft-new-release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index dc50a0f..66918cc 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -73,13 +73,10 @@ jobs: - name: Create pull request uses: repo-sync/pull-request@v2 id: pull_request - env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} with: source_branch: release/${{ github.event.inputs.version }} destination_branch: stable pr_title: Release version ${{ github.event.inputs.version }} - pr_reviewer: ${{ github.actor }} pr_body: | This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}. Please, check that the version files and changelogs are correct. From a75756f6fb0db78e50a91dc396725fd2ca1a0dab Mon Sep 17 00:00:00 2001 From: aarroyosal Date: Mon, 21 Nov 2022 16:04:55 +0000 Subject: [PATCH 13/13] Edit changelog versions --- clouds/bigquery/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clouds/bigquery/CHANGELOG.md b/clouds/bigquery/CHANGELOG.md index b5c9648..844c3b9 100644 --- a/clouds/bigquery/CHANGELOG.md +++ b/clouds/bigquery/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [1.4.0] - 2022-11-16 ### Changed