Repository navigation
152 lines (144 loc) · 5.43 KB
/
Copy pathrelease-compose.yml
File metadata and controls
152 lines (144 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Compose source candidate on ATR
on:
workflow_dispatch:
inputs:
candidate:
description: Full SHA of the reviewed source commit on the selected branch
type: string
required: true
rc:
description: Candidate version, for example 0.59.2-rc.1
type: string
required: true
workflow_call:
inputs:
candidate:
type: string
required: true
rc:
type: string
required: true
secrets:
GPG_SECRET_KEY:
required: true
permissions:
contents: read
concurrency:
group: source-release-compose
cancel-in-progress: false
jobs:
source_bundle:
if: github.repository == 'apache/opendal'
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
artifact-id: ${{ steps.bundle.outputs.artifact-id }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.candidate }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Validate reviewed candidate identity
env:
CANDIDATE: ${{ inputs.candidate }}
RC: ${{ inputs.rc }}
run: |
python3 - <<'PYTHON'
import os, re, subprocess
assert re.fullmatch(r"[0-9a-f]{40}", os.environ["CANDIDATE"]), "full candidate SHA required"
assert re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+-rc\.[1-9][0-9]*", os.environ["RC"]), "RC version required"
if os.environ["GITHUB_EVENT_NAME"] == "workflow_dispatch" and os.environ["GITHUB_WORKFLOW"] == "Compose source candidate on ATR":
subprocess.run(["git", "merge-base", "--is-ancestor", os.environ["CANDIDATE"], os.environ["GITHUB_SHA"]], check=True)
subprocess.run(["git", "cat-file", "-e", os.environ["CANDIDATE"] + "^{commit}"], check=True)
PYTHON
- uses: ./.github/actions/setup
- name: Prepare unsigned candidate without signing credentials
env:
CANDIDATE: ${{ inputs.candidate }}
run: python3 scripts/verify_source_reproducibility.py --revision "$CANDIDATE" --output "$RUNNER_TEMP/source-bundle"
- uses: actions/upload-artifact@v7
id: bundle
with:
name: source-candidate-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/source-bundle/*.tar.gz
${{ runner.temp }}/source-bundle/*.sha512
${{ runner.temp }}/source-bundle/report.json
if-no-files-found: error
source_sign:
needs: source_bundle
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
artifact-id: ${{ steps.signed.outputs.artifact-id }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.candidate }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.source_bundle.outputs.artifact-id }}
path: ${{ runner.temp }}/source-bundle
merge-multiple: true
- name: Sign the exact source bundle
env:
CANDIDATE: ${{ inputs.candidate }}
RC: ${{ inputs.rc }}
SOURCE_SIGNING_FINGERPRINT: ${{ vars.SOURCE_SIGNING_FINGERPRINT }}
SOURCE_SIGNING_KEY: ${{ secrets.GPG_SECRET_KEY }}
SOURCE_SIGNING_PASSPHRASE: ""
run: python3 scripts/sign_source_release.py "$RUNNER_TEMP/source-bundle" "$CANDIDATE" "$RC" "$RUNNER_TEMP/signed-source"
- uses: actions/upload-artifact@v7
id: signed
with:
name: signed-source-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/signed-source/
if-no-files-found: error
source_compose:
needs: source_sign
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.source_sign.outputs.artifact-id }}
path: ${{ runner.temp }}/signed-source
merge-multiple: true
- name: Upload candidate to ATR compose
uses: apache/tooling-actions/upload-to-atr@fa721a0b176d713807b574da721b96545b587eea
with:
project: opendal
version: ${{ inputs.rc }}
src: ${{ runner.temp }}/signed-source
- name: Record staging handoff
run: |
echo 'Candidate uploaded to ATR compose. Inspect ATR checks and independently rebuild the downloaded files before starting a vote. This workflow does not vote or finish a release.' >> "$GITHUB_STEP_SUMMARY"