Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Full Queue Developer committed Feb 7, 2023
1 parent eb83e76 commit c84151a
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 54 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ on:

jobs:
build:
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
name: CI on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-12
swift: "5.7"

steps:
- uses: fwal/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- run: swift --version
- uses: actions/checkout@v3

Expand Down

This file was deleted.

This file was deleted.

21 changes: 21 additions & 0 deletions Sources/ShXcrun/Altool/Credential/ApiKeyCredential.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
public struct ApiKeyCredential: AltoolCredential {

let keyID: String
let issuerID: String

public init(keyID: String, issuerID: String) {
self.keyID = keyID
self.issuerID = issuerID
}

public var serialized: String {
"--apiKey $SH_XCRUN_ALTOOL_API_KEY_ID --apiIssuer $SH_XCRUN_ALTOOL_API_ISSUER_ID"
}

public var environment: [String: String] {
[
"SH_XCRUN_ALTOOL_API_KEY_ID": keyID,
"SH_XCRUN_ALTOOL_API_ISSUER_ID": issuerID,
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
public struct EnvironmentVariablePasswordCredential: AltoolCredential {

let username: String
let environmentVariable: String

public init(username: String, environmentVariable: String) {
self.username = username
self.environmentVariable = environmentVariable
}

public var serialized: String {
"-u \(username) -p @env:\(environmentVariable)"
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
extension AltoolCredential where Self == KeychainPasswordCredential {
public static func password(username: String? = nil, keychain: String) -> Self {
Self(username: username, keychain: keychain)
}
}

public struct KeychainPasswordCredential: AltoolCredential {

let username: String?
let keychain: String

public init(username: String?, keychain: String) {
self.username = username
self.keychain = keychain
}

public var serialized: String {
"\(usernameIfPresent) -p @keychain:\(keychain)"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
extension AltoolCredential where Self == LiteralPasswordCredential {
public static func password(username: String, password: String) -> Self {
Self(username: username, password: password)
}
}

public struct LiteralPasswordCredential: AltoolCredential {

let username: String
let password: String

public init(username: String, password: String) {
self.username = username
self.password = password
}

public var serialized: String {
"-u \(username) -p @env:SH_XCRUN_ALTOOL_PASSWORD"
}
Expand Down

0 comments on commit c84151a

Please sign in to comment.