Skip to content

Commit 01106a1

Browse files
authored
Create stage-release-candidate.yml (#2689)
* Create stage-release-candidate.yml * Update stage-release-candidate.yml
1 parent c6967c4 commit 01106a1

1 file changed

Lines changed: 280 additions & 0 deletions

File tree

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Stage release candidate
19+
20+
on:
21+
workflow_dispatch:
22+
inputs:
23+
source-tar:
24+
description: "Stage the source tarball to svn"
25+
default: true
26+
type: boolean
27+
jars:
28+
description: "Stage the binary jars to nexus"
29+
default: true
30+
type: boolean
31+
email-template:
32+
description: "Generate vote email template"
33+
default: true
34+
type: boolean
35+
36+
permissions:
37+
contents: read
38+
39+
jobs:
40+
# Automating the step at https://github.com/apache/pekko-site/wiki/Pekko-Release-Process#build-the-source-release-candidate
41+
# Partly based on https://github.com/apache/daffodil/blob/main/.github/workflows/release-candidate.yml
42+
stage-release-candidate-to-svn:
43+
runs-on: ubuntu-24.04
44+
if: ${{ inputs.source-tar }}
45+
steps:
46+
- name: Check version parameter
47+
run: |-
48+
# To be enabled after this workflow has been tested:
49+
#if [[ "$REF" != "v"* ]]; then
50+
# echo "Trigger this workflow on a version tag"
51+
# exit 1
52+
#fi
53+
if [[ "$REF" != *"-RC"* ]]; then
54+
echo "Trigger this workflow on an RC tag"
55+
exit 1
56+
fi
57+
export VERSION=$(echo $REF | sed -e "s/.\(.*\)-.*/\\1/")
58+
export RC_VERSION=$(echo $REF | tail -c +2)
59+
echo "Version: $VERSION"
60+
echo "RC Version: $RC_VERSION"
61+
env:
62+
REF: ${{ github.ref_name }}
63+
64+
- name: Checkout
65+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v5.0.1
66+
with:
67+
fetch-depth: 0
68+
fetch-tags: true
69+
persist-credentials: false
70+
71+
- name: Generate source archive
72+
run: |-
73+
VERSION=$(echo $REF | sed -e "s/.\(.*\)-.*/\\1/")
74+
PREFIX=apache-pekko-$VERSION
75+
DATE=$(git log -n1 --format=%cs | tr -d -)
76+
TARBALL=$PREFIX-src-$DATE.tgz
77+
78+
mkdir archive
79+
git archive --format=tar --prefix=$PREFIX/ HEAD | gzip -6 -n > archive/$TARBALL
80+
cd archive
81+
sha512sum $TARBALL > $TARBALL.sha512
82+
env:
83+
REF: ${{ github.ref_name }}
84+
85+
- name: Sign source archive
86+
run: |-
87+
echo "$PEKKO_GPG_SECRET_KEY" | gpg --batch --import --import-options import-show
88+
gpg -ab archive/*.tgz
89+
env:
90+
PEKKO_GPG_SECRET_KEY: ${{ secrets.PEKKO_GPG_SECRET_KEY }}
91+
92+
- name: Install Apache Subversion
93+
run: |-
94+
sudo apt-get update
95+
sudo apt-get install -y subversion
96+
97+
- name: Upload source dist
98+
run: |-
99+
svn checkout https://dist.apache.org/repos/dist/dev/pekko dist
100+
cd dist
101+
102+
export RC_VERSION=$(echo $REF | tail -c +2)
103+
104+
mkdir $RC_VERSION
105+
cp ../archive/* $RC_VERSION
106+
svn add $RC_VERSION
107+
svn commit --username "$PEKKO_SVN_DEV_USERNAME" --password "$PEKKO_SVN_DEV_PASSWORD" --message "Stage Pekko $RC_VERSION" $RC_VERSION
108+
env:
109+
PEKKO_SVN_DEV_USERNAME: ${{ secrets.PEKKO_SVN_DEV_USERNAME }}
110+
PEKKO_SVN_DEV_PASSWORD: ${{ secrets.PEKKO_SVN_DEV_PASSWORD }}
111+
REF: ${{ github.ref_name }}
112+
113+
stage-jars-to-nexus:
114+
runs-on: ubuntu-24.04
115+
if: ${{ inputs.jars }}
116+
steps:
117+
- name: Check version parameter
118+
run: |-
119+
# To be enabled after this workflow has been tested:
120+
#if [[ "$REF" != "v"* ]]; then
121+
# echo "Trigger this workflow on a version tag"
122+
# exit 1
123+
#fi
124+
if [[ "$REF" != *"-RC"* ]]; then
125+
echo "Trigger this workflow on an RC tag"
126+
exit 1
127+
fi
128+
export VERSION=$(echo $REF | sed -e "s/\(.*\)-.*/\\1/")
129+
export RC_VERSION=$(echo $REF | tail -c +2)
130+
echo "Version: $VERSION"
131+
echo "RC Version: $RC_VERSION"
132+
env:
133+
REF: ${{ github.ref_name }}
134+
135+
- name: Checkout
136+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v5.0.1
137+
with:
138+
fetch-depth: 0
139+
fetch-tags: true
140+
persist-credentials: false
141+
142+
- name: Setup Java 17
143+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
144+
with:
145+
distribution: temurin
146+
java-version: 17
147+
148+
- name: Install sbt
149+
uses: sbt/setup-sbt@06192244f17880c9bf69ccd8de5b2e8785822be5 # v1.1.17
150+
151+
# We intentionally do not use the Coursier cache for release candiates,
152+
# to reduce attack surface
153+
154+
# It would be better to split this into 3 steps, where only the first
155+
# uses sbt and the signing/staging are done with well-known tools
156+
# reducing attack surface, but this seems to be the state of the art:
157+
- name: Build, sign and stage artifacts
158+
run: |-
159+
VERSION=$(echo $REF | sed -e "s/.\(.*\)-.*/\\1/")
160+
echo "$PEKKO_GPG_SECRET_KEY" | gpg --batch --import --import-options import-show
161+
162+
sbt "set ThisBuild / version := \"$VERSION\"; +publishSigned"
163+
sbt "set ThisBuild / version := \"$VERSION\"; sonatypePrepare; set ThisBuild / version := \"$VERSION\"; sonatypeBundleUpload; sonatypeClose"
164+
env:
165+
REF: ${{ github.ref_name }}
166+
PEKKO_GPG_SECRET_KEY: ${{ secrets.PEKKO_GPG_SECRET_KEY }}
167+
SONATYPE_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}
168+
SONATYPE_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}
169+
170+
email-template:
171+
runs-on: ubuntu-24.04
172+
if: ${{ inputs.email-template }}
173+
steps:
174+
- name: Generate vote email template
175+
env:
176+
REF: ${{ github.ref_name }}
177+
run: |-
178+
export MODULE="Pekko (Core)"
179+
export VERSION=$(echo $REF | sed -e "s/.\(.*\)-.*/\\1/")
180+
export RC_VERSION=$(echo $REF | tail -c +2)
181+
echo "VERSION=$VERSION"
182+
echo "RC_VERSION=$RC_VERSION"
183+
184+
export DISCUSS=$(curl 'https://lists.apache.org/api/stats.lua?list=dev&domain=pekko.apache.org' | jq ".emails.[] | .subject, .mid" | grep -A1 "$MODULE $VERSION" | tail -1 | tr -d \")
185+
echo "DISCUSS=$DISCUSS"
186+
export DISCUSS_THREAD=https://lists.apache.org/thread/$(curl "https://lists.apache.org/api/thread.lua?id=$DISCUSS&find_parent=true" | jq .thread.mid | tr -d \")
187+
echo "DISCUSS_THREAD=$DISCUSS_THREAD"
188+
189+
export RELEASE_NOTES=https://github.com/apache/pekko/pull/$(curl https://api.github.com/repos/apache/pekko/pulls?state=all | jq ".[] | .title, .number" | grep -A1 "Release notes for $VERSION" | tail -1)
190+
echo "RELEASE_NOTES=$RELEASE_NOTES"
191+
192+
export SENDER=$(curl "https://api.github.com/users/$ACTOR" | jq .name | tr -d \")
193+
echo "SENDER=$SENDER"
194+
195+
echo "This template can be used to start a vote, either via manual email or via https://release-test.apache.org/compose/pekko/$VERSION"
196+
echo
197+
cat <<EOF;
198+
Subject: [VOTE] Release Apache $MODULE $RC_VERSION
199+
200+
Hello Pekko Community,
201+
202+
This is a call for a vote to release Apache $MODULE version $RC_VERSION
203+
204+
The discussion thread:
205+
206+
$DISCUSS_THREAD
207+
208+
The release candidate:
209+
210+
https://dist.apache.org/repos/dist/dev/pekko/$RC_VERSION
211+
https://release-test.apache.org/vote/pekko/$VERSION
212+
213+
This release has been signed with a PGP key available here:
214+
215+
https://downloads.apache.org/pekko/KEYS
216+
217+
Release Notes:
218+
219+
$RELEASE_NOTES
220+
221+
Git branch for the release:
222+
223+
https://github.com/apache/pekko/tree/v$RC_VERSION
224+
Git commit ID: $COMMIT_SHA
225+
226+
Please download, verify, and test.
227+
228+
We have also staged jars in the Apache Nexus Repository. These were built with the same code
229+
as appears in this Source Release Candidate. We would appreciate if users could test with these too.
230+
If anyone finds any serious problems with these jars, please also notify us on this thread.
231+
232+
https://repository.apache.org/content/groups/staging/org/apache/pekko/
233+
234+
You can add this resolver to sbt with 'resolvers += Resolver.ApacheMavenStagingRepo'
235+
236+
The VOTE will pass if we have more positive votes than negative votes
237+
and there must be a minimum of 3 approvals from Pekko PMC members.
238+
Anyone voting in favour of the release, could you please provide a list of the checks you have done?
239+
The vote will be left open until [VOTE_ENDS_UTC].
240+
241+
[ ] +1 approve
242+
[ ] +0 no opinion
243+
[ ] -1 disapprove with the reason
244+
245+
To learn more about Apache Pekko, please see https://pekko.apache.org/
246+
247+
Checklist for reference:
248+
249+
[ ] Download links are valid.
250+
[ ] Checksums and signatures.
251+
[ ] LICENSE/NOTICE files exist
252+
[ ] No unexpected binary files
253+
[ ] All source files have ASF headers
254+
[ ] Can compile from source
255+
[ ] Can verify the binary build
256+
257+
To compile from the source, please refer to:
258+
259+
https://github.com/apache/pekko/blob/$REF/README.md#building-from-source
260+
261+
To verify the binary build, please refer to:
262+
263+
https://github.com/apache/pekko-site/wiki/Pekko-Release-Process#verifying-the-binary-build
264+
265+
Some notes about verifying downloads can be found at:
266+
267+
https://pekko.apache.org/download.html#verifying-downloads
268+
269+
You can vote on ATR at https://release-test.apache.org/vote/pekko/$VERSION
270+
or manually by replying to this email.
271+
272+
273+
Thanks,
274+
275+
$SENDER (Apache Pekko PMC member)
276+
EOF
277+
env:
278+
REF: ${{ github.ref_name }}
279+
COMMIT_SHA: ${{ github.sha }}
280+
ACTOR: ${{ github.actor }}

0 commit comments

Comments
 (0)