Skip to content

Commit

Permalink
chore: Update Smithy doc & smithy-swift references (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins authored Aug 30, 2023
1 parent f4ac130 commit 93a2e5b
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 451 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
2 changes: 1 addition & 1 deletion Package.swift
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
4 changes: 2 additions & 2 deletions THIRD-PARTY-LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ Licensed under Apache License v2.0 with Runtime Library Exception

------

** aws-crt-swift; version 0.2.2 -- https://github.com/awslabs/aws-crt-swift
** aws-crt-swift -- https://github.com/awslabs/aws-crt-swift
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
** smithy-swift; version 0.2.4 -- https://github.com/awslabs/smithy-swift
** smithy-swift -- https://github.com/smithy-lang/smithy-swift
Smithy Swift
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import software.amazon.smithy.model.shapes.ServiceShape
import software.amazon.smithy.swift.codegen.model.expectTrait

/**
* Get the [sdkId](https://awslabs.github.io/smithy/1.0/spec/aws/aws-core.html#sdkid) from the (AWS) service shape
* Get the [sdkId](https://smithy.io/2.0/aws/aws-core.html#sdkid) from the (AWS) service shape
*/
val ServiceShape.sdkId: String
get() = expectTrait<ServiceTrait>().sdkId

/**
* Get the [arnNamespace](https://awslabs.github.io/smithy/1.0/spec/aws/aws-core.html#service-arn-namespace)
* Get the [arnNamespace](https://smithy.io/2.0/aws/aws-core.html#arnnamespace)
* from the (AWS) service shape
*/
val ServiceShape.arnNamespace: String
get() = expectTrait<ServiceTrait>().arnNamespace

/**
* Get the [endpointPrefix](https://awslabs.github.io/smithy/1.0/spec/aws/aws-core.html#endpointprefix)
* Get the [endpointPrefix](https://smithy.io/2.0/aws/aws-core.html#endpointprefix)
* from the (AWS) service shape
*/
val ServiceShape.endpointPrefix: String
Expand Down
Loading

0 comments on commit 93a2e5b

Please sign in to comment.