Skip to content

Commit 500c02b

Browse files
authored
ci(release): Move to getsentry/publish for releases (#775)
A copy of getsentry/sentry#22657 with fixes included. That said this one is a bit different. We used to use the extra option `no-merge` when publishing to keep the release branches and also keep master on nightly versions. If we want to keep this, we need to add per-project overrides to getsentry/publish which would increase complexity at this early stage for this fringe case. Instead, I opted to follow what getsentry/sentry does: merge but then immediately after that update the version.
1 parent 04d80fa commit 500c02b

File tree

4 files changed

+26
-32
lines changed

4 files changed

+26
-32
lines changed

.craft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
minVersion: "0.10.0"
1+
minVersion: "0.14.0"
22
github:
33
owner: getsentry
44
repo: onpremise

.github/workflows/release.yml

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,9 @@ on:
55
version:
66
description: Version to release (optional)
77
required: false
8-
skip_prepare:
9-
description: Skip preparation step (assume a release branch is ready)
10-
required: false
11-
default: false
12-
dry_run:
13-
description: Do not actually cut the release
14-
required: false
15-
default: false
168
force:
17-
description: Force the release, bypassing the 'release-blocker' issue killswitch
9+
description: Force a release even when there are release-blockers (optional)
1810
required: false
19-
default: false
2011
schedule:
2112
# We want the release to be at 10 or 11am Pacific Time
2213
# We also make this an hour after all others such as Sentry,
@@ -34,29 +25,22 @@ jobs:
3425
force: ${{ github.event.inputs.force }}
3526
- uses: actions/checkout@v2
3627
with:
37-
token: ${{ secrets.GH_SENTRY_BOT_PAT }}
28+
token: ${{ secrets.GH_RELEASE_PAT }}
29+
fetch-depth: 0
3830
- uses: getsentry/craft@master
3931
name: Craft Prepare
40-
if: ${{ !github.event.inputs.skip_prepare }}
4132
with:
4233
action: prepare
4334
version: ${{ env.RELEASE_VERSION }}
44-
# Wait until the builds start. Craft should do this automatically
45-
# but it is broken now.
46-
- run: sleep 10
47-
- uses: getsentry/craft@master
48-
name: Craft Publish
35+
- name: Request publish
36+
if: success()
37+
uses: actions/github-script@v3
4938
with:
50-
action: publish
51-
version: ${{ env.RELEASE_VERSION }}
52-
no_merge: '--no-merge'
53-
env:
54-
DRY_RUN: ${{ github.event.inputs.dry_run }}
55-
# We need this additional step because we don't merge release branches into master to
56-
# always keep it on nightlies
57-
- id: bump-license-date
58-
name: Bump license change date
59-
if: ${{ !github.event.inputs.dry_run && !github.event.inputs.version }}
60-
run: |
61-
sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d' -d '3 years')/" LICENSE
62-
git diff --quiet || git commit -anm 'license: Update BSL change date' && git push
39+
github-token: ${{ secrets.GH_RELEASE_PAT }}
40+
script: |
41+
const repoInfo = context.repo;
42+
await github.issues.create({
43+
owner: repoInfo.owner,
44+
repo: 'publish',
45+
title: `publish: ${repoInfo.repo}@${process.env.RELEASE_VERSION}`,
46+
});

scripts/bump-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cd $SCRIPT_DIR/..
77
OLD_VERSION="$1"
88
NEW_VERSION="$2"
99

10-
SYMBOLICATOR_VERSION=$(curl -s "https://api.github.com/repos/getsentry/symbolicator/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
10+
SYMBOLICATOR_VERSION=${SYMBOLICATOR_VERSION:-$(curl -s "https://api.github.com/repos/getsentry/symbolicator/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')}
1111

1212
sed -i -e "s/^SYMBOLICATOR_IMAGE=\([^:]\+\):.\+\$/SYMBOLICATOR_IMAGE=\1:$SYMBOLICATOR_VERSION/" .env
1313
sed -i -e "s/^\(SENTRY\|SNUBA\|RELAY\)_IMAGE=\([^:]\+\):.\+\$/\1_IMAGE=\2:$NEW_VERSION/" .env

scripts/post-release.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
cd $SCRIPT_DIR/..
6+
7+
# Bring master back to nightlies after merge from release branch
8+
9+
SYMBOLICATOR_VERSION=nightly ./scripts/bump-version.sh '' 'nightly'
10+
git diff --quiet || git commit -anm 'build: Set master version to nightly' && git push

0 commit comments

Comments
 (0)