Skip to content

Commit

Permalink
Merge branch 'main' into fix/make-operations-model-service-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sichanyoo authored Sep 12, 2023
2 parents c29dd2e + 0235f28 commit 0db429e
Show file tree
Hide file tree
Showing 20 changed files with 683 additions and 453 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:
- name: Select smithy-swift branch
run: |
ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \
DEPENDENCY_REPO_URL="https://github.com/awslabs/smithy-swift.git" \
DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \
./scripts/ci_steps/select_dependency_branch.sh
- name: Checkout smithy-swift
uses: actions/checkout@v3
with:
repository: awslabs/smithy-swift
repository: smithy-lang/smithy-swift
ref: ${{ env.DEPENDENCY_REPO_SHA }}
path: smithy-swift
- name: Move smithy-swift into place
Expand Down Expand Up @@ -113,12 +113,12 @@ jobs:
- name: Select smithy-swift branch
run: |
ORIGINAL_REPO_HEAD_REF="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-main}}" \
DEPENDENCY_REPO_URL="https://github.com/awslabs/smithy-swift.git" \
DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \
./scripts/ci_steps/select_dependency_branch.sh
- name: Checkout smithy-swift
uses: actions/checkout@v3
with:
repository: awslabs/smithy-swift
repository: smithy-lang/smithy-swift
ref: ${{ env.DEPENDENCY_REPO_SHA }}
path: smithy-swift
- name: Move smithy-swift into place
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/model-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- name: Select smithy-swift branch
run: |
ORIGINAL_REPO_HEAD_REF="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-main}}" \
DEPENDENCY_REPO_URL="https://github.com/awslabs/smithy-swift.git" \
DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \
./scripts/ci_steps/select_dependency_branch.sh
- name: Checkout smithy-swift
uses: actions/checkout@v3
with:
repository: awslabs/smithy-swift
repository: smithy-lang/smithy-swift
ref: ${{ env.DEPENDENCY_REPO_SHA }}
path: smithy-swift
- name: Move smithy-swift into place
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,24 @@ struct PrepareReleaseCommand: ParsableCommand {

@Argument(help: "The repository type to release. sdk or smithy-swift")
var repoType: PrepareRelease.Repo

@Argument(help: "The path to the git repository.")
var repoPath: String

@Argument(help: "The artifactId for the source code")
var sourceCodeArtifactId: String

func run() throws {
let repoOrg: PrepareRelease.Org
switch repoType {
case .awsSdkSwift:
repoOrg = .awslabs
case .smithySwift:
repoOrg = .smithyLang
}
let prepareRelease = PrepareRelease.standard(
repoType: repoType,
repoOrg: repoOrg,
repoPath: repoPath,
sourceCodeArtifactId: sourceCodeArtifactId
)
Expand All @@ -45,10 +53,18 @@ struct PrepareRelease {
case awsSdkSwift = "aws-sdk-swift"
case smithySwift = "smithy-swift"
}

enum Org: String, ExpressibleByArgument {
case awslabs = "awslabs"
case smithyLang = "smithy-lang"
}

/// The repository type to prepare the release
/// This dictates which files are staged for commit
let repoType: Repo

/// The GitHub org that the repo belongs to
let repoOrg: Org

/// The path to the package repository
let repoPath: String
Expand Down Expand Up @@ -174,6 +190,7 @@ struct PrepareRelease {
let releaseNotes = ReleaseNotesBuilder(
previousVersion: previousVersion,
newVersion: newVersion,
repoOrg: repoOrg,
repoType: repoType,
commits: commits
).build()
Expand Down Expand Up @@ -208,11 +225,13 @@ extension PrepareRelease {
/// - Returns: The standard release preparer
static func standard(
repoType: Repo,
repoOrg: Org,
repoPath: String,
sourceCodeArtifactId: String
) -> Self {
PrepareRelease(
repoType: repoType,
repoOrg: repoOrg,
repoPath: repoPath,
sourceCodeArtifactId: sourceCodeArtifactId
) { branch, version in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import PackageDescription
struct ReleaseNotesBuilder {
let previousVersion: Version
let newVersion: Version
let repoOrg: PrepareRelease.Org
let repoType: PrepareRelease.Repo
let commits: [String]

Expand All @@ -22,7 +23,7 @@ struct ReleaseNotesBuilder {
"## What's Changed",
buildCommits(),
.newline,
"**Full Changelog**: https://github.com/awslabs/\(repoType.rawValue)/compare/\(previousVersion)...\(newVersion)"
"**Full Changelog**: https://github.com/\(repoOrg.rawValue)/\(repoType.rawValue)/compare/\(previousVersion)...\(newVersion)"
]
return contents.joined(separator: .newline)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func addDependencies(clientRuntimeVersion: Version, crtVersion: Version) {
}

func addClientRuntimeDependency(_ version: Version) {
let smithySwiftURL = "https://github.com/awslabs/smithy-swift"
let smithySwiftURL = "https://github.com/smithy-lang/smithy-swift"
let useLocalDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_LOCAL_DEPS"] != nil
let useMainDeps = ProcessInfo.processInfo.environment["AWS_SWIFT_SDK_USE_MAIN_DEPS"] != nil
switch (useLocalDeps, useMainDeps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ extension PrepareRelease {
) -> Self {
PrepareRelease(
repoType: repoType,
repoOrg: .awslabs,
repoPath: repoPath,
sourceCodeArtifactId: sourceCodeArtifactId,
diffChecker: diffChecker
Expand Down
Loading

0 comments on commit 0db429e

Please sign in to comment.