From 89cbf38c51b374e03ee3d47ae15423e42266dd53 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Tue, 15 Dec 2020 15:04:51 +0300 Subject: [PATCH 1/2] ci(release): Move to getsentry/publish for releases A copy of getsentry/sentry#22657 with fixes included --- .craft.yml | 2 +- .github/workflows/release.yml | 44 +++++++++++------------------------ scripts/bump-version.sh | 2 +- scripts/post-release.sh | 12 ++++++++++ 4 files changed, 28 insertions(+), 32 deletions(-) create mode 100755 scripts/post-release.sh diff --git a/.craft.yml b/.craft.yml index ad41cd872f6..fcc29e73df9 100644 --- a/.craft.yml +++ b/.craft.yml @@ -1,4 +1,4 @@ -minVersion: "0.10.0" +minVersion: "0.14.0" github: owner: getsentry repo: onpremise diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a411c04ac8..e8e93ad7a5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,18 +5,9 @@ on: version: description: Version to release (optional) required: false - skip_prepare: - description: Skip preparation step (assume a release branch is ready) - required: false - default: false - dry_run: - description: Do not actually cut the release - required: false - default: false force: - description: Force the release, bypassing the 'release-blocker' issue killswitch + description: Force a release even when there are release-blockers (optional) required: false - default: false schedule: # We want the release to be at 10 or 11am Pacific Time # We also make this an hour after all others such as Sentry, @@ -34,29 +25,22 @@ jobs: force: ${{ github.event.inputs.force }} - uses: actions/checkout@v2 with: - token: ${{ secrets.GH_SENTRY_BOT_PAT }} + token: ${{ secrets.GH_RELEASE_PAT }} + fetch-depth: 0 - uses: getsentry/craft@master name: Craft Prepare - if: ${{ !github.event.inputs.skip_prepare }} with: action: prepare version: ${{ env.RELEASE_VERSION }} - # Wait until the builds start. Craft should do this automatically - # but it is broken now. - - run: sleep 10 - - uses: getsentry/craft@master - name: Craft Publish + - name: Request publish + if: success() + uses: actions/github-script@v3 with: - action: publish - version: ${{ env.RELEASE_VERSION }} - no_merge: '--no-merge' - env: - DRY_RUN: ${{ github.event.inputs.dry_run }} - # We need this additional step because we don't merge release branches into master to - # always keep it on nightlies - - id: bump-license-date - name: Bump license change date - if: ${{ !github.event.inputs.dry_run && !github.event.inputs.version }} - run: | - sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d' -d '3 years')/" LICENSE - git diff --quiet || git commit -anm 'license: Update BSL change date' && git push + github-token: ${{ secrets.GH_RELEASE_PAT }} + script: | + const repoInfo = context.repo; + await github.issues.create({ + owner: repoInfo.owner, + repo: 'publish', + title: `publish: ${repoInfo.repo}@${process.env.RELEASE_VERSION}`, + }); diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 4172c7e4d30..4c8bb5a5d30 100644 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -7,7 +7,7 @@ cd $SCRIPT_DIR/.. OLD_VERSION="$1" NEW_VERSION="$2" -SYMBOLICATOR_VERSION=$(curl -s "https://api.github.com/repos/getsentry/symbolicator/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') +SYMBOLICATOR_VERSION=${SYMBOLICATOR_VERSION:-$(curl -s "https://api.github.com/repos/getsentry/symbolicator/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')} sed -i -e "s/^SYMBOLICATOR_IMAGE=\([^:]\+\):.\+\$/SYMBOLICATOR_IMAGE=\1:$SYMBOLICATOR_VERSION/" .env sed -i -e "s/^\(SENTRY\|SNUBA\|RELAY\)_IMAGE=\([^:]\+\):.\+\$/\1_IMAGE=\2:$NEW_VERSION/" .env diff --git a/scripts/post-release.sh b/scripts/post-release.sh new file mode 100755 index 00000000000..9984ac21d58 --- /dev/null +++ b/scripts/post-release.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eu + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $SCRIPT_DIR/.. + +# Bring master back to nightlies after merge from release branch + +SYMBOLICATOR_VERSION=nightly + +./scripts/bump-version.sh '' 'nightly' +git diff --quiet || git commit -anm 'build: Set master version to nightly' && git push From c49abc0abc7f20b5d8c906f51cee1ed0b6ff8ed9 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Tue, 15 Dec 2020 15:13:43 +0300 Subject: [PATCH 2/2] make SYMBOLICATOR_VERSION available to bump-version --- scripts/post-release.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/post-release.sh b/scripts/post-release.sh index 9984ac21d58..ff8e7066c25 100755 --- a/scripts/post-release.sh +++ b/scripts/post-release.sh @@ -6,7 +6,5 @@ cd $SCRIPT_DIR/.. # Bring master back to nightlies after merge from release branch -SYMBOLICATOR_VERSION=nightly - -./scripts/bump-version.sh '' 'nightly' +SYMBOLICATOR_VERSION=nightly ./scripts/bump-version.sh '' 'nightly' git diff --quiet || git commit -anm 'build: Set master version to nightly' && git push