forked from awslabs/aws-sdk-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 2.01 KB
/
release-checks.yaml
File metadata and controls
60 lines (50 loc) · 2.01 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
on:
pull_request:
branches:
- main
workflow_dispatch:
name: Release Configuration Checks
permissions:
contents: read
jobs:
check-config:
runs-on: ubuntu-latest
name: Check Release config.json
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: main
path: main-branch
- name: Check smithy-rs version exists
run: |
SMITHY_RS_VERSION=$(jq -r ".dependencies.smithyRsVersion" config.json)
echo "checking smithy-rs@$SMITHY_RS_VERSION"
mkdir smithy-rs
cd smithy-rs
git init
git remote add origin https://github.com/smithy-lang/smithy-rs.git
if git fetch origin $SMITHY_RS_VERSION; then
echo "smithy-rs@$SMITHY_RS_VERSION found"
else
echo "::error::no smithy-rs@$SMITHY_RS_VERSION found"
exit 1
fi
- name: Check for tools changes in smithy-rs
run: |
CURRENT_SMITHY_RS_VERSION=$(jq -r ".dependencies.smithyRsVersion" config.json)
echo "Current branch smithyRsVersion: $CURRENT_SMITHY_RS_VERSION"
MAIN_SMITHY_RS_VERSION=$(jq -r ".dependencies.smithyRsVersion" main-branch/config.json)
echo "Main branch smithyRsVersion: $MAIN_SMITHY_RS_VERSION"
cd smithy-rs
git fetch origin --tags -q
# Check for tools changes between main branch version and current version
CHANGED_FILES=$(git diff --name-only $MAIN_SMITHY_RS_VERSION..$CURRENT_SMITHY_RS_VERSION)
if echo "$CHANGED_FILES" | grep -q "^tools/"; then
echo "::error::Tools changes detected between $MAIN_SMITHY_RS_VERSION and $CURRENT_SMITHY_RS_VERSION"
echo "$CHANGED_FILES" | grep "^tools/"
echo "::error::Complete an internal release before updating config.json. After completion, use the bot user to force-merge this PR to main."
exit 1
else
echo "No tools changes detected - check passed"
fi