-
Notifications
You must be signed in to change notification settings - Fork 196
70 lines (65 loc) · 2.08 KB
/
update-sdk-next.yml
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
# This workflow updates the `next` branch with freshly generated
# code from the latest smithy-rs and models that reside in aws-sdk-rust.
# Allow only one release to run at a time
concurrency:
group: update-aws-sdk-next
cancel-in-progress: true
name: Update `aws-sdk-rust/next`
on:
workflow_dispatch:
inputs:
generate_ref:
description: |
Which branch/commit/tag of smithy-rs to use to generate aws-sdk-rust/next. Defaults to `main`.
required: true
type: string
default: main
jobs:
update-next:
name: Update `next`
runs-on: ubuntu-latest
steps:
- name: Check out `smithy-rs`
uses: actions/checkout@v3
with:
repository: awslabs/smithy-rs
ref: ${{ inputs.generate_ref }}
path: smithy-rs
- name: Check out `aws-sdk-rust`
uses: actions/checkout@v3
with:
repository: awslabs/aws-sdk-rust
ref: main
path: aws-sdk-rust
token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: corretto
java-package: jdk
java-version: 11
# Rust is only used to `rustfmt` the generated code; doesn't need to match MSRV
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0
- name: Delete old SDK
run: |
- name: Generate a fresh SDK
run: |
WORKSPACE="$(pwd)"
cd smithy-rs
./gradlew aws:sdk:assemble --info -Paws.sdk.models.path="${WORKSPACE}/aws-sdk-rust/aws-models"
- name: Update `aws-sdk-rust/next`
run: |
set -eux
cd aws-sdk-rust
git checkout origin/main -b next
# Delete the old SDK
rm -rf sdk examples tests
rm -f versions.toml Cargo.toml index.md
# Copy in the new SDK
mv ../smithy-rs/aws/sdk/build/aws-sdk/* .
git add .
git -c 'user.name=AWS SDK Rust Bot' -c 'user.email=aws-sdk-rust-primary@amazon.com' commit -m 'Update `aws-sdk-rust/next`' --allow-empty
git push origin next:next --force