Skip to content

Commit 7251962

Browse files
Merge branch 'main' into RFC30/serde-decorator
2 parents cbe908a + 82b190c commit 7251962

File tree

554 files changed

+10371
-6020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

554 files changed

+10371
-6020
lines changed

.github/workflows/ci-merge-queue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
needs:
8585
- save-docker-login-token
8686
- acquire-base-image
87-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' || toJSON(github.event.merge_group) != '{}' }}
87+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' || toJSON(github.event.merge_group) != '{}' }}
8888
uses: ./.github/workflows/ci.yml
8989
with:
9090
run_sdk_examples: true

.github/workflows/ci-pr-forks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# it uploads the image as a build artifact for other jobs to download and use.
1919
acquire-base-image:
2020
name: Acquire Base Image
21-
if: ${{ github.event.pull_request.head.repo.full_name != 'awslabs/smithy-rs' }}
21+
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v3
@@ -39,7 +39,7 @@ jobs:
3939
# Run shared CI after the Docker build image has either been rebuilt or found in ECR
4040
ci:
4141
needs: acquire-base-image
42-
if: ${{ github.event.pull_request.head.repo.full_name != 'awslabs/smithy-rs' }}
42+
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
4343
uses: ./.github/workflows/ci.yml
4444
with:
4545
run_sdk_examples: true

.github/workflows/ci-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# The login password is encrypted with the repo secret DOCKER_LOGIN_TOKEN_PASSPHRASE
2222
save-docker-login-token:
2323
name: Save a docker login token
24-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
24+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
2525
outputs:
2626
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
2727
permissions:
@@ -51,7 +51,7 @@ jobs:
5151
acquire-base-image:
5252
name: Acquire Base Image
5353
needs: save-docker-login-token
54-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
54+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
5555
runs-on: smithy_ubuntu-latest_8-core
5656
env:
5757
ENCRYPTED_DOCKER_PASSWORD: ${{ needs.save-docker-login-token.outputs.docker-login-password }}
@@ -86,7 +86,7 @@ jobs:
8686
needs:
8787
- save-docker-login-token
8888
- acquire-base-image
89-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
89+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
9090
uses: ./.github/workflows/ci.yml
9191
with:
9292
run_sdk_examples: true
@@ -97,7 +97,7 @@ jobs:
9797
# The PR bot requires a Docker build image, so make it depend on the `acquire-base-image` job.
9898
pr_bot:
9999
name: PR Bot
100-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
100+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
101101
needs: acquire-base-image
102102
uses: ./.github/workflows/pull-request-bot.yml
103103
with:

.github/workflows/release.yml

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,65 @@ env:
1313
rust_version: 1.70.0
1414

1515
name: Release smithy-rs
16-
run-name: ${{ github.workflow }} ${{ inputs.semantic_version }} (${{ inputs.commit_sha }}) - ${{ inputs.dry_run && 'Dry run' || 'Production run' }}
16+
run-name: ${{ inputs.dry_run && 'Dry run' || 'Prod run' }} - ${{ github.workflow }} ${{ inputs.stable_semantic_version }}/${{ inputs.unstable_semantic_version }} (${{ inputs.commit_sha }})
1717
on:
1818
workflow_dispatch:
1919
inputs:
2020
commit_sha:
2121
description: |
22-
The SHA of the git commit that you want to release.
22+
Commit SHA: The SHA of the git commit that you want to release.
2323
You must use the non-abbreviated SHA (e.g. b2318b0 won't work!).
2424
required: true
2525
type: string
26-
semantic_version:
27-
description: The semver tag that you want to release (e.g. 0.52.1)
26+
stable_semantic_version:
27+
description: |
28+
Stable semantic version: The semver tag that you want to release for stable crates (e.g. 1.0.2)
29+
required: true
30+
type: string
31+
unstable_semantic_version:
32+
description: |
33+
Unstable semantic version: The semver tag that you want to release for unstable crates (e.g. 0.52.1)
2834
required: true
2935
type: string
3036
dry_run:
31-
description: Dry runs will only produce release artifacts, but they will not cut a release tag in GitHub nor publish to crates.io
37+
description: |
38+
Dry run: When selected, it only produces release artifacts, but will not cut a release tag in GitHub or publish to crates.io
3239
required: true
3340
type: boolean
3441
default: true
3542

3643
jobs:
44+
check-actor-for-prod-run:
45+
name: Check actor for prod run
46+
if: inputs.dry_run == false
47+
runs-on: ubuntu-latest
48+
env:
49+
ACTOR: ${{ github.actor }}
50+
steps:
51+
- name: Check actor for prod run
52+
run: |
53+
set -e
54+
55+
if [ "${ACTOR}" != "aws-sdk-rust-ci" ]; then
56+
echo "Error: The current actor is '${ACTOR}' but only 'aws-sdk-rust-ci' is allowed to run a prod release workflow."
57+
exit 1
58+
fi
59+
60+
echo "The current actor is 'aws-sdk-rust-ci', continuing with the workflow."
61+
3762
# We'll need to build a base image to work against if:
3863
# - a release was kicked off before the image build step triggered by a push to the release branch/main completed
3964
# - a dry-run release was kicked off against a feature branch to test automation changes
4065
# This job will be a no-op if an image had already been built.
4166
acquire-base-image:
4267
name: Acquire Base Image
68+
needs:
69+
- check-actor-for-prod-run
70+
# We need `always` here otherwise this job won't run if the previous job has been skipped
71+
# See https://samanpavel.medium.com/github-actions-conditional-job-execution-e6aa363d2867
72+
if: |
73+
always() &&
74+
(needs.check-actor-for-prod-run.result == 'success' || needs.check-actor-for-prod-run.result == 'skipped')
4375
runs-on: smithy_ubuntu-latest_16-core
4476
steps:
4577
- uses: actions/checkout@v3
@@ -92,7 +124,7 @@ jobs:
92124
id: branch-push
93125
shell: bash
94126
env:
95-
SEMANTIC_VERSION: ${{ inputs.semantic_version }}
127+
SEMANTIC_VERSION: ${{ inputs.stable_semantic_version }}
96128
DRY_RUN: ${{ inputs.dry_run }}
97129
run: |
98130
set -e
@@ -125,15 +157,15 @@ jobs:
125157
uses: ./smithy-rs/.github/actions/docker-build
126158
with:
127159
action: upgrade-gradle-properties
128-
action-arguments: ${{ inputs.semantic_version }}
160+
action-arguments: ${{ inputs.stable_semantic_version }} ${{ inputs.unstable_semantic_version }}
129161
- name: Download all artifacts
130162
uses: ./smithy-rs/.github/actions/download-all-artifacts
131163
- name: Push gradle.properties changes
132164
id: gradle-push
133165
working-directory: upgrade-gradle-properties/smithy-rs
134166
shell: bash
135167
env:
136-
SEMANTIC_VERSION: ${{ inputs.semantic_version }}
168+
SEMANTIC_VERSION: ${{ inputs.stable_semantic_version }}
137169
RELEASE_COMMIT_SHA: ${{ inputs.commit_sha }}
138170
RELEASE_BRANCH_NAME: ${{ needs.get-or-create-release-branch.outputs.release_branch }}
139171
DRY_RUN: ${{ inputs.dry_run }}
@@ -152,7 +184,13 @@ jobs:
152184
# to retry a release action execution that failed due to a transient issue.
153185
# In that case, we expect the commit to be releasable as-is, i.e. the runtime crate version in gradle.properties
154186
# should already be the expected one.
155-
git push origin "HEAD:refs/heads/${RELEASE_BRANCH_NAME}"
187+
if [[ "${DRY_RUN}" == "true" ]]; then
188+
# During dry-runs, "git push" without "--force" can fail if smithy-rs-release-x.y.z-preview is behind
189+
# smithy-rs-release-x.y.z, but that does not matter much during dry-runs.
190+
git push --force origin "HEAD:refs/heads/${RELEASE_BRANCH_NAME}"
191+
else
192+
git push origin "HEAD:refs/heads/${RELEASE_BRANCH_NAME}"
193+
fi
156194
157195
echo "commit_sha=$(git rev-parse HEAD)" > $GITHUB_OUTPUT
158196
else
@@ -193,6 +231,7 @@ jobs:
193231
id: push-changelog
194232
env:
195233
RELEASE_BRANCH_NAME: ${{ needs.upgrade-gradle-properties.outputs.release_branch }}
234+
DRY_RUN: ${{ inputs.dry_run }}
196235
run: |
197236
if ! git diff-index --quiet HEAD; then
198237
echo "Pushing release commits..."
@@ -201,7 +240,13 @@ jobs:
201240
# to retry a release action execution that failed due to a transient issue.
202241
# In that case, we expect the commit to be releasable as-is, i.e. the changelog should have already
203242
# been processed.
204-
git push origin "HEAD:refs/heads/${RELEASE_BRANCH_NAME}"
243+
if [[ "${DRY_RUN}" == "true" ]]; then
244+
# During dry-runs, "git push" without "--force" can fail if smithy-rs-release-x.y.z-preview is behind
245+
# smithy-rs-release-x.y.z, but that does not matter much during dry-runs.
246+
git push --force origin "HEAD:refs/heads/${RELEASE_BRANCH_NAME}"
247+
else
248+
git push origin "HEAD:refs/heads/${RELEASE_BRANCH_NAME}"
249+
fi
205250
fi
206251
echo "commit_sha=$(git rev-parse HEAD)" > $GITHUB_OUTPUT
207252
- name: Tag release

.github/workflows/update-sdk-next.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Check out `smithy-rs`
2626
uses: actions/checkout@v3
2727
with:
28-
repository: awslabs/smithy-rs
28+
repository: smithy-lang/smithy-rs
2929
ref: ${{ inputs.generate_ref }}
3030
path: smithy-rs
3131
- name: Check out `aws-sdk-rust`

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
exclude: ^aws/rust-runtime/aws-sigv4/aws-sig-v4-test-suite/
88
- id: trailing-whitespace
99
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
10-
rev: v2.10.0
10+
rev: v2.11.0
1111
hooks:
1212
- id: pretty-format-kotlin
1313
args: [--autofix, --ktlint-version, 0.48.2]

0 commit comments

Comments
 (0)